Preserve YAML element order

This commit is contained in:
ME1312 2017-11-22 16:58:33 -05:00
parent affac1cd56
commit a019383bc3
49 changed files with 1162 additions and 246 deletions

View File

@ -4,15 +4,9 @@
#!/usr/bin/env bash
if [ -z "$1" ]
then
if [ -z "$2" ]
then
echo "SubServers Library Patcher: Combines BungeeCord and SubServers.Bungee/SubServers.Sync into one jar file"
echo "Usage: bash $0 <BungeeCord.jar> <SubServers.jar>"
exit 0
else
echo ERROR: No BungeeCord File Supplied
exit 1
fi
echo "SubServers Library Patcher: Combines BungeeCord and SubServers.Bungee/SubServers.Sync into one jar file"
echo "Usage: bash $0 <BungeeCord.jar> <SubServers.jar>"
exit 1
fi
if [ ! -f "$1" ]
then
@ -72,20 +66,16 @@ if [ $retvala -eq 0 ]
if [ $retvalc -eq 0 ]
then
echo ">> Cleaning Up..."
rm -Rf ../../Buildtools
exit 0;
else
echo ">> Error Recomiling Files"
rm -Rf ../../Buildtools
exit 4
fi
else
echo ">> Error Decompiling $2 Files"
rm -Rf ../../Buildtools
echo ">> Error Decompiling $2"
exit 3
fi
else
echo ">> Error Decompiling $1 Files"
rm -Rf ../../Buildtools
echo ">> Error Decompiling $1"
exit 3
fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2510,10 +2510,22 @@
<dd>
<div class="block">Set Object into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#safeSet-java.lang.String-V:A-">safeSet(String, V[])</a></span> - Method in class net.ME1312.SubServers.Bungee.Library.Config.<a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#safeSet-java.lang.String-java.util.Collection-">safeSet(String, Collection&lt;V&gt;)</a></span> - Method in class net.ME1312.SubServers.Bungee.Library.Config.<a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set Collection&lt;V&gt; into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#safeSetAll-java.util.Map-">safeSetAll(Map&lt;String, ?&gt;)</a></span> - Method in class net.ME1312.SubServers.Bungee.Library.Config.<a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#safeSetAll-net.ME1312.SubServers.Bungee.Library.Config.YAMLSection-">safeSetAll(YAMLSection)</a></span> - Method in class net.ME1312.SubServers.Bungee.Library.Config.<a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLConfig.html#save--">save()</a></span> - Method in class net.ME1312.SubServers.Bungee.Library.Config.<a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLConfig.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLConfig</a></dt>
<dd>
<div class="block">Save Config Contents</div>
@ -2544,6 +2556,10 @@
<dd>
<div class="block">Set Object into this YAML Section</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#set-java.lang.String-V:A-">set(String, V[])</a></span> - Method in class net.ME1312.SubServers.Bungee.Library.Config.<a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set V[] into this YAML Section</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#set-java.lang.String-java.util.Collection-">set(String, Collection&lt;V&gt;)</a></span> - Method in class net.ME1312.SubServers.Bungee.Library.Config.<a href="net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set Collection&lt;V&gt; into this YAML Section</div>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10};
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10,"i80":10,"i81":10,"i82":10,"i83":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -643,43 +643,69 @@ extends java.lang.Object</pre>
</tr>
<tr id="i73" class="rowColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#safeSet-java.lang.String-V:A-">safeSet</a></span>(java.lang.String&nbsp;handle,
V[]&nbsp;array)</code>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
</td>
</tr>
<tr id="i74" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#safeSetAll-java.util.Map-">safeSetAll</a></span>(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</code>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
</td>
</tr>
<tr id="i75" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#safeSetAll-net.ME1312.SubServers.Bungee.Library.Config.YAMLSection-">safeSetAll</a></span>(<a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a>&nbsp;values)</code>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
</td>
</tr>
<tr id="i76" class="altColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#set-java.lang.String-java.util.Collection-">set</a></span>(java.lang.String&nbsp;handle,
java.util.Collection&lt;V&gt;&nbsp;list)</code>
<div class="block">Set Collection&lt;V&gt; into this YAML Section</div>
</td>
</tr>
<tr id="i74" class="altColor">
<tr id="i77" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#set-java.lang.String-java.lang.Object-">set</a></span>(java.lang.String&nbsp;handle,
java.lang.Object&nbsp;value)</code>
<div class="block">Set Object into this YAML Section</div>
</td>
</tr>
<tr id="i75" class="rowColor">
<tr id="i78" class="altColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#set-java.lang.String-V:A-">set</a></span>(java.lang.String&nbsp;handle,
V[]&nbsp;array)</code>
<div class="block">Set V[] into this YAML Section</div>
</td>
</tr>
<tr id="i79" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#setAll-java.util.Map-">setAll</a></span>(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</code>
<div class="block">Set All Objects into this YAML Section</div>
</td>
</tr>
<tr id="i76" class="altColor">
<tr id="i80" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#setAll-net.ME1312.SubServers.Bungee.Library.Config.YAMLSection-">setAll</a></span>(<a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a>&nbsp;values)</code>
<div class="block">Copy YAML Values to this YAML Section</div>
</td>
</tr>
<tr id="i77" class="rowColor">
<tr id="i81" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#superSection--">superSection</a></span>()</code>
<div class="block">Go up a level in the config (or null if this is the top layer)</div>
</td>
</tr>
<tr id="i78" class="altColor">
<tr id="i82" class="altColor">
<td class="colFirst"><code>org.json.JSONObject</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#toJSON--">toJSON</a></span>()</code>
<div class="block">Convert to JSON</div>
</td>
</tr>
<tr id="i79" class="rowColor">
<tr id="i83" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
@ -888,6 +914,46 @@ extends java.lang.Object</pre>
</dl>
</li>
</ul>
<a name="set-java.lang.String-java.lang.Object:A-">
<!-- -->
</a><a name="set-java.lang.String-V:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre>public&nbsp;&lt;V&gt;&nbsp;void&nbsp;set(java.lang.String&nbsp;handle,
V[]&nbsp;array)</pre>
<div class="block">Set V[] into this YAML Section</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - Array Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handle</code> - Handle</dd>
<dd><code>array</code> - Value</dd>
</dl>
</li>
</ul>
<a name="safeSet-java.lang.String-java.lang.Object:A-">
<!-- -->
</a><a name="safeSet-java.lang.String-V:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSet</h4>
<pre>public&nbsp;&lt;V&gt;&nbsp;void&nbsp;safeSet(java.lang.String&nbsp;handle,
V[]&nbsp;array)</pre>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - Array Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handle</code> - Handle</dd>
<dd><code>array</code> - Value</dd>
</dl>
</li>
</ul>
<a name="set-java.lang.String-java.util.Collection-">
<!-- -->
</a>
@ -948,7 +1014,35 @@ extends java.lang.Object</pre>
<div class="block">Copy YAML Values to this YAML Section</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - Values</dd>
<dd><code>values</code> - YAMLSection to merge</dd>
</dl>
</li>
</ul>
<a name="safeSetAll-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSetAll</h4>
<pre>public&nbsp;void&nbsp;safeSetAll(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</pre>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - Map to set</dd>
</dl>
</li>
</ul>
<a name="safeSetAll-net.ME1312.SubServers.Bungee.Library.Config.YAMLSection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSetAll</h4>
<pre>public&nbsp;void&nbsp;safeSetAll(<a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Bungee.Library.Config">YAMLSection</a>&nbsp;values)</pre>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - YAMLSection to merge</dd>
</dl>
</li>
</ul>

Binary file not shown.

View File

@ -1493,10 +1493,22 @@
<dd>
<div class="block">Set Object into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#safeSet-java.lang.String-V:A-">safeSet(String, V[])</a></span> - Method in class net.ME1312.SubServers.Client.Bukkit.Library.Config.<a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#safeSet-java.lang.String-java.util.Collection-">safeSet(String, Collection&lt;V&gt;)</a></span> - Method in class net.ME1312.SubServers.Client.Bukkit.Library.Config.<a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set Collection&lt;V&gt; into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#safeSetAll-java.util.Map-">safeSetAll(Map&lt;String, ?&gt;)</a></span> - Method in class net.ME1312.SubServers.Client.Bukkit.Library.Config.<a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#safeSetAll-net.ME1312.SubServers.Client.Bukkit.Library.Config.YAMLSection-">safeSetAll(YAMLSection)</a></span> - Method in class net.ME1312.SubServers.Client.Bukkit.Library.Config.<a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLConfig.html#save--">save()</a></span> - Method in class net.ME1312.SubServers.Client.Bukkit.Library.Config.<a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLConfig.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLConfig</a></dt>
<dd>
<div class="block">Save Config Contents</div>
@ -1531,6 +1543,10 @@
<dd>
<div class="block">Set Object into this YAML Section</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#set-java.lang.String-V:A-">set(String, V[])</a></span> - Method in class net.ME1312.SubServers.Client.Bukkit.Library.Config.<a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set V[] into this YAML Section</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#set-java.lang.String-java.util.Collection-">set(String, Collection&lt;V&gt;)</a></span> - Method in class net.ME1312.SubServers.Client.Bukkit.Library.Config.<a href="net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set Collection&lt;V&gt; into this YAML Section</div>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10};
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10,"i80":10,"i81":10,"i82":10,"i83":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -643,43 +643,69 @@ extends java.lang.Object</pre>
</tr>
<tr id="i73" class="rowColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#safeSet-java.lang.String-V:A-">safeSet</a></span>(java.lang.String&nbsp;handle,
V[]&nbsp;array)</code>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
</td>
</tr>
<tr id="i74" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#safeSetAll-java.util.Map-">safeSetAll</a></span>(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</code>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
</td>
</tr>
<tr id="i75" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#safeSetAll-net.ME1312.SubServers.Client.Bukkit.Library.Config.YAMLSection-">safeSetAll</a></span>(<a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a>&nbsp;values)</code>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
</td>
</tr>
<tr id="i76" class="altColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#set-java.lang.String-java.util.Collection-">set</a></span>(java.lang.String&nbsp;handle,
java.util.Collection&lt;V&gt;&nbsp;list)</code>
<div class="block">Set Collection&lt;V&gt; into this YAML Section</div>
</td>
</tr>
<tr id="i74" class="altColor">
<tr id="i77" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#set-java.lang.String-java.lang.Object-">set</a></span>(java.lang.String&nbsp;handle,
java.lang.Object&nbsp;value)</code>
<div class="block">Set Object into this YAML Section</div>
</td>
</tr>
<tr id="i75" class="rowColor">
<tr id="i78" class="altColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#set-java.lang.String-V:A-">set</a></span>(java.lang.String&nbsp;handle,
V[]&nbsp;array)</code>
<div class="block">Set V[] into this YAML Section</div>
</td>
</tr>
<tr id="i79" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#setAll-java.util.Map-">setAll</a></span>(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</code>
<div class="block">Set All Objects into this YAML Section</div>
</td>
</tr>
<tr id="i76" class="altColor">
<tr id="i80" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#setAll-net.ME1312.SubServers.Client.Bukkit.Library.Config.YAMLSection-">setAll</a></span>(<a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a>&nbsp;values)</code>
<div class="block">Copy YAML Values to this YAML Section</div>
</td>
</tr>
<tr id="i77" class="rowColor">
<tr id="i81" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#superSection--">superSection</a></span>()</code>
<div class="block">Go up a level in the config (or null if this is the top layer)</div>
</td>
</tr>
<tr id="i78" class="altColor">
<tr id="i82" class="altColor">
<td class="colFirst"><code>org.json.JSONObject</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#toJSON--">toJSON</a></span>()</code>
<div class="block">Convert to JSON</div>
</td>
</tr>
<tr id="i79" class="rowColor">
<tr id="i83" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
@ -888,6 +914,46 @@ extends java.lang.Object</pre>
</dl>
</li>
</ul>
<a name="set-java.lang.String-java.lang.Object:A-">
<!-- -->
</a><a name="set-java.lang.String-V:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre>public&nbsp;&lt;V&gt;&nbsp;void&nbsp;set(java.lang.String&nbsp;handle,
V[]&nbsp;array)</pre>
<div class="block">Set V[] into this YAML Section</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - Array Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handle</code> - Handle</dd>
<dd><code>array</code> - Value</dd>
</dl>
</li>
</ul>
<a name="safeSet-java.lang.String-java.lang.Object:A-">
<!-- -->
</a><a name="safeSet-java.lang.String-V:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSet</h4>
<pre>public&nbsp;&lt;V&gt;&nbsp;void&nbsp;safeSet(java.lang.String&nbsp;handle,
V[]&nbsp;array)</pre>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - Array Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handle</code> - Handle</dd>
<dd><code>array</code> - Value</dd>
</dl>
</li>
</ul>
<a name="set-java.lang.String-java.util.Collection-">
<!-- -->
</a>
@ -948,7 +1014,35 @@ extends java.lang.Object</pre>
<div class="block">Copy YAML Values to this YAML Section</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - Values</dd>
<dd><code>values</code> - YAMLSection to merge</dd>
</dl>
</li>
</ul>
<a name="safeSetAll-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSetAll</h4>
<pre>public&nbsp;void&nbsp;safeSetAll(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</pre>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - Map to set</dd>
</dl>
</li>
</ul>
<a name="safeSetAll-net.ME1312.SubServers.Client.Bukkit.Library.Config.YAMLSection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSetAll</h4>
<pre>public&nbsp;void&nbsp;safeSetAll(<a href="../../../../../../../net/ME1312/SubServers/Client/Bukkit/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Client.Bukkit.Library.Config">YAMLSection</a>&nbsp;values)</pre>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - YAMLSection to merge</dd>
</dl>
</li>
</ul>

Binary file not shown.

View File

@ -1819,10 +1819,22 @@
<dd>
<div class="block">Set Object into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#safeSet-java.lang.String-V:A-">safeSet(String, V[])</a></span> - Method in class net.ME1312.SubServers.Host.Library.Config.<a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#safeSet-java.lang.String-java.util.Collection-">safeSet(String, Collection&lt;V&gt;)</a></span> - Method in class net.ME1312.SubServers.Host.Library.Config.<a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set Collection&lt;V&gt; into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#safeSetAll-java.util.Map-">safeSetAll(Map&lt;String, ?&gt;)</a></span> - Method in class net.ME1312.SubServers.Host.Library.Config.<a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#safeSetAll-net.ME1312.SubServers.Host.Library.Config.YAMLSection-">safeSetAll(YAMLSection)</a></span> - Method in class net.ME1312.SubServers.Host.Library.Config.<a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/Library/Config/YAMLConfig.html#save--">save()</a></span> - Method in class net.ME1312.SubServers.Host.Library.Config.<a href="net/ME1312/SubServers/Host/Library/Config/YAMLConfig.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLConfig</a></dt>
<dd>
<div class="block">Save Config Contents</div>
@ -1869,6 +1881,10 @@
<dd>
<div class="block">Set Object into this YAML Section</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#set-java.lang.String-V:A-">set(String, V[])</a></span> - Method in class net.ME1312.SubServers.Host.Library.Config.<a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set V[] into this YAML Section</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#set-java.lang.String-java.util.Collection-">set(String, Collection&lt;V&gt;)</a></span> - Method in class net.ME1312.SubServers.Host.Library.Config.<a href="net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set Collection&lt;V&gt; into this YAML Section</div>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10};
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10,"i80":10,"i81":10,"i82":10,"i83":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -643,43 +643,69 @@ extends java.lang.Object</pre>
</tr>
<tr id="i73" class="rowColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#safeSet-java.lang.String-V:A-">safeSet</a></span>(java.lang.String&nbsp;handle,
V[]&nbsp;array)</code>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
</td>
</tr>
<tr id="i74" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#safeSetAll-java.util.Map-">safeSetAll</a></span>(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</code>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
</td>
</tr>
<tr id="i75" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#safeSetAll-net.ME1312.SubServers.Host.Library.Config.YAMLSection-">safeSetAll</a></span>(<a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a>&nbsp;values)</code>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
</td>
</tr>
<tr id="i76" class="altColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#set-java.lang.String-java.util.Collection-">set</a></span>(java.lang.String&nbsp;handle,
java.util.Collection&lt;V&gt;&nbsp;list)</code>
<div class="block">Set Collection&lt;V&gt; into this YAML Section</div>
</td>
</tr>
<tr id="i74" class="altColor">
<tr id="i77" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#set-java.lang.String-java.lang.Object-">set</a></span>(java.lang.String&nbsp;handle,
java.lang.Object&nbsp;value)</code>
<div class="block">Set Object into this YAML Section</div>
</td>
</tr>
<tr id="i75" class="rowColor">
<tr id="i78" class="altColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#set-java.lang.String-V:A-">set</a></span>(java.lang.String&nbsp;handle,
V[]&nbsp;array)</code>
<div class="block">Set V[] into this YAML Section</div>
</td>
</tr>
<tr id="i79" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#setAll-java.util.Map-">setAll</a></span>(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</code>
<div class="block">Set All Objects into this YAML Section</div>
</td>
</tr>
<tr id="i76" class="altColor">
<tr id="i80" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#setAll-net.ME1312.SubServers.Host.Library.Config.YAMLSection-">setAll</a></span>(<a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a>&nbsp;values)</code>
<div class="block">Copy YAML Values to this YAML Section</div>
</td>
</tr>
<tr id="i77" class="rowColor">
<tr id="i81" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#superSection--">superSection</a></span>()</code>
<div class="block">Go up a level in the config (or null if this is the top layer)</div>
</td>
</tr>
<tr id="i78" class="altColor">
<tr id="i82" class="altColor">
<td class="colFirst"><code>org.json.JSONObject</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#toJSON--">toJSON</a></span>()</code>
<div class="block">Convert to JSON</div>
</td>
</tr>
<tr id="i79" class="rowColor">
<tr id="i83" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
@ -888,6 +914,46 @@ extends java.lang.Object</pre>
</dl>
</li>
</ul>
<a name="set-java.lang.String-java.lang.Object:A-">
<!-- -->
</a><a name="set-java.lang.String-V:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre>public&nbsp;&lt;V&gt;&nbsp;void&nbsp;set(java.lang.String&nbsp;handle,
V[]&nbsp;array)</pre>
<div class="block">Set V[] into this YAML Section</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - Array Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handle</code> - Handle</dd>
<dd><code>array</code> - Value</dd>
</dl>
</li>
</ul>
<a name="safeSet-java.lang.String-java.lang.Object:A-">
<!-- -->
</a><a name="safeSet-java.lang.String-V:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSet</h4>
<pre>public&nbsp;&lt;V&gt;&nbsp;void&nbsp;safeSet(java.lang.String&nbsp;handle,
V[]&nbsp;array)</pre>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - Array Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handle</code> - Handle</dd>
<dd><code>array</code> - Value</dd>
</dl>
</li>
</ul>
<a name="set-java.lang.String-java.util.Collection-">
<!-- -->
</a>
@ -948,7 +1014,35 @@ extends java.lang.Object</pre>
<div class="block">Copy YAML Values to this YAML Section</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - Values</dd>
<dd><code>values</code> - YAMLSection to merge</dd>
</dl>
</li>
</ul>
<a name="safeSetAll-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSetAll</h4>
<pre>public&nbsp;void&nbsp;safeSetAll(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</pre>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - Map to set</dd>
</dl>
</li>
</ul>
<a name="safeSetAll-net.ME1312.SubServers.Host.Library.Config.YAMLSection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSetAll</h4>
<pre>public&nbsp;void&nbsp;safeSetAll(<a href="../../../../../../net/ME1312/SubServers/Host/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Host.Library.Config">YAMLSection</a>&nbsp;values)</pre>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - YAMLSection to merge</dd>
</dl>
</li>
</ul>

Binary file not shown.

View File

@ -1321,10 +1321,22 @@
<dd>
<div class="block">Set Object into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#safeSet-java.lang.String-V:A-">safeSet(String, V[])</a></span> - Method in class net.ME1312.SubServers.Sync.Library.Config.<a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#safeSet-java.lang.String-java.util.Collection-">safeSet(String, Collection&lt;V&gt;)</a></span> - Method in class net.ME1312.SubServers.Sync.Library.Config.<a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set Collection&lt;V&gt; into this YAML Section without overwriting existing value</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#safeSetAll-java.util.Map-">safeSetAll(Map&lt;String, ?&gt;)</a></span> - Method in class net.ME1312.SubServers.Sync.Library.Config.<a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#safeSetAll-net.ME1312.SubServers.Sync.Library.Config.YAMLSection-">safeSetAll(YAMLSection)</a></span> - Method in class net.ME1312.SubServers.Sync.Library.Config.<a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Sync/Library/Config/YAMLConfig.html#save--">save()</a></span> - Method in class net.ME1312.SubServers.Sync.Library.Config.<a href="net/ME1312/SubServers/Sync/Library/Config/YAMLConfig.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLConfig</a></dt>
<dd>
<div class="block">Save Config Contents</div>
@ -1349,6 +1361,10 @@
<dd>
<div class="block">Set Object into this YAML Section</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#set-java.lang.String-V:A-">set(String, V[])</a></span> - Method in class net.ME1312.SubServers.Sync.Library.Config.<a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set V[] into this YAML Section</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#set-java.lang.String-java.util.Collection-">set(String, Collection&lt;V&gt;)</a></span> - Method in class net.ME1312.SubServers.Sync.Library.Config.<a href="net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a></dt>
<dd>
<div class="block">Set Collection&lt;V&gt; into this YAML Section</div>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10};
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10,"i71":10,"i72":10,"i73":10,"i74":10,"i75":10,"i76":10,"i77":10,"i78":10,"i79":10,"i80":10,"i81":10,"i82":10,"i83":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -643,43 +643,69 @@ extends java.lang.Object</pre>
</tr>
<tr id="i73" class="rowColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#safeSet-java.lang.String-V:A-">safeSet</a></span>(java.lang.String&nbsp;handle,
V[]&nbsp;array)</code>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
</td>
</tr>
<tr id="i74" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#safeSetAll-java.util.Map-">safeSetAll</a></span>(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</code>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
</td>
</tr>
<tr id="i75" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#safeSetAll-net.ME1312.SubServers.Sync.Library.Config.YAMLSection-">safeSetAll</a></span>(<a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a>&nbsp;values)</code>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
</td>
</tr>
<tr id="i76" class="altColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#set-java.lang.String-java.util.Collection-">set</a></span>(java.lang.String&nbsp;handle,
java.util.Collection&lt;V&gt;&nbsp;list)</code>
<div class="block">Set Collection&lt;V&gt; into this YAML Section</div>
</td>
</tr>
<tr id="i74" class="altColor">
<tr id="i77" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#set-java.lang.String-java.lang.Object-">set</a></span>(java.lang.String&nbsp;handle,
java.lang.Object&nbsp;value)</code>
<div class="block">Set Object into this YAML Section</div>
</td>
</tr>
<tr id="i75" class="rowColor">
<tr id="i78" class="altColor">
<td class="colFirst"><code>&lt;V&gt;&nbsp;void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#set-java.lang.String-V:A-">set</a></span>(java.lang.String&nbsp;handle,
V[]&nbsp;array)</code>
<div class="block">Set V[] into this YAML Section</div>
</td>
</tr>
<tr id="i79" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#setAll-java.util.Map-">setAll</a></span>(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</code>
<div class="block">Set All Objects into this YAML Section</div>
</td>
</tr>
<tr id="i76" class="altColor">
<tr id="i80" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#setAll-net.ME1312.SubServers.Sync.Library.Config.YAMLSection-">setAll</a></span>(<a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a>&nbsp;values)</code>
<div class="block">Copy YAML Values to this YAML Section</div>
</td>
</tr>
<tr id="i77" class="rowColor">
<tr id="i81" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#superSection--">superSection</a></span>()</code>
<div class="block">Go up a level in the config (or null if this is the top layer)</div>
</td>
</tr>
<tr id="i78" class="altColor">
<tr id="i82" class="altColor">
<td class="colFirst"><code>org.json.JSONObject</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#toJSON--">toJSON</a></span>()</code>
<div class="block">Convert to JSON</div>
</td>
</tr>
<tr id="i79" class="rowColor">
<tr id="i83" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
@ -888,6 +914,46 @@ extends java.lang.Object</pre>
</dl>
</li>
</ul>
<a name="set-java.lang.String-java.lang.Object:A-">
<!-- -->
</a><a name="set-java.lang.String-V:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre>public&nbsp;&lt;V&gt;&nbsp;void&nbsp;set(java.lang.String&nbsp;handle,
V[]&nbsp;array)</pre>
<div class="block">Set V[] into this YAML Section</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - Array Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handle</code> - Handle</dd>
<dd><code>array</code> - Value</dd>
</dl>
</li>
</ul>
<a name="safeSet-java.lang.String-java.lang.Object:A-">
<!-- -->
</a><a name="safeSet-java.lang.String-V:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSet</h4>
<pre>public&nbsp;&lt;V&gt;&nbsp;void&nbsp;safeSet(java.lang.String&nbsp;handle,
V[]&nbsp;array)</pre>
<div class="block">Set V[] into this YAML Section without overwriting existing value</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - Array Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handle</code> - Handle</dd>
<dd><code>array</code> - Value</dd>
</dl>
</li>
</ul>
<a name="set-java.lang.String-java.util.Collection-">
<!-- -->
</a>
@ -948,7 +1014,35 @@ extends java.lang.Object</pre>
<div class="block">Copy YAML Values to this YAML Section</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - Values</dd>
<dd><code>values</code> - YAMLSection to merge</dd>
</dl>
</li>
</ul>
<a name="safeSetAll-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSetAll</h4>
<pre>public&nbsp;void&nbsp;safeSetAll(java.util.Map&lt;java.lang.String,?&gt;&nbsp;values)</pre>
<div class="block">Set All Objects into this YAML Section without overwriting existing values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - Map to set</dd>
</dl>
</li>
</ul>
<a name="safeSetAll-net.ME1312.SubServers.Sync.Library.Config.YAMLSection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>safeSetAll</h4>
<pre>public&nbsp;void&nbsp;safeSetAll(<a href="../../../../../../net/ME1312/SubServers/Sync/Library/Config/YAMLSection.html" title="class in net.ME1312.SubServers.Sync.Library.Config">YAMLSection</a>&nbsp;values)</pre>
<div class="block">Copy YAML Values to this YAML Section without overwriting existing values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - YAMLSection to merge</dd>
</dl>
</li>
</ul>

View File

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

Binary file not shown.

View File

@ -75,29 +75,31 @@ public class ExternalSubCreator extends SubCreator {
if (host.plugin.exServers.keySet().contains(name.toLowerCase()))
host.plugin.exServers.remove(name.toLowerCase());
YAMLSection server = new YAMLSection(json.getJSONObject("c"));
for (String option : server.getKeys()) {
if (server.isString(option)) {
server.set(option, server.getRawString(option).replace("$name$", name).replace("$template$", template.getName()).replace("$type$", template.getType().toString())
YAMLSection server = new YAMLSection();
YAMLSection config = new YAMLSection(json.getJSONObject("c"));
for (String option : config.getKeys()) {
if (config.isString(option)) {
config.set(option, config.getRawString(option).replace("$name$", name).replace("$template$", template.getName()).replace("$type$", template.getType().toString())
.replace("$version$", version.toString().replace(" ", "@")).replace("$port$", Integer.toString(port)));
}
}
if (!server.contains("Enabled")) server.set("Enabled", true);
if (!server.contains("Display")) server.set("Display", "");
if (!server.contains("Host")) server.set("Host", host.getName());
if (!server.contains("Group")) server.set("Group", new ArrayList<String>());
if (!server.contains("Port")) server.set("Port", port);
if (!server.contains("Motd")) server.set("Motd", "Some SubServer");
if (!server.contains("Log")) server.set("Log", true);
if (!server.contains("Directory")) server.set("Directory", "." + File.separatorChar + name);
if (!server.contains("Executable")) server.set("Executable", "java -Xmx1024M -jar " + template.getType().toString() + ".jar");
if (!server.contains("Stop-Command")) server.set("Stop-Command", "stop");
if (!server.contains("Run-On-Launch")) server.set("Run-On-Launch", false);
if (!server.contains("Auto-Restart")) server.set("Auto-Restart", false);
if (!server.contains("Restricted")) server.set("Restricted", false);
if (!server.contains("Incompatible")) server.set("Incompatible", new ArrayList<String>());
if (!server.contains("Hidden")) server.set("Hidden", false);
server.set("Enabled", true);
server.set("Display", "");
server.set("Host", host.getName());
server.set("Group", new ArrayList<String>());
server.set("Port", port);
server.set("Motd", "Some SubServer");
server.set("Log", true);
server.set("Directory", "." + File.separatorChar + name);
server.set("Executable", "java -Xmx1024M -jar " + template.getType().toString() + ".jar");
server.set("Stop-Command", "stop");
server.set("Run-On-Launch", false);
server.set("Auto-Restart", false);
server.set("Restricted", false);
server.set("Incompatible", new ArrayList<String>());
server.set("Hidden", false);
server.setAll(config);
SubServer subserver = host.addSubServer(player, name, server.getBoolean("Enabled"), port, server.getColoredString("Motd", '&'), server.getBoolean("Log"), server.getRawString("Directory"),
new Executable(server.getRawString("Executable")), server.getRawString("Stop-Command"), true, server.getBoolean("Auto-Restart"), server.getBoolean("Hidden"), server.getBoolean("Restricted"), false);

View File

@ -5,15 +5,14 @@ import net.ME1312.SubServers.Bungee.Library.Config.YAMLValue;
import net.ME1312.SubServers.Bungee.Library.Exception.InvalidHostException;
import net.ME1312.SubServers.Bungee.Library.Exception.InvalidServerException;
import net.ME1312.SubServers.Bungee.Library.ExtraDataHandler;
import net.ME1312.SubServers.Bungee.Library.NamedContainer;
import net.ME1312.SubServers.Bungee.Library.Util;
import net.ME1312.SubServers.Bungee.Network.ClientHandler;
import net.ME1312.SubServers.Bungee.Network.SubDataServer;
import net.ME1312.SubServers.Bungee.SubPlugin;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import org.json.JSONObject;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Map;
import java.util.UUID;
@ -36,7 +35,6 @@ public abstract class Host implements ExtraDataHandler {
*/
public Host(SubPlugin plugin, String name, Boolean enabled, InetAddress address, String directory, String gitBash) {
if (name.contains(" ")) throw new InvalidHostException("Host names cannot have spaces: " + name);
if (name.equals("~")) nick = "Default";
SubDataServer.allowConnection(address);
}
@ -396,6 +394,20 @@ public abstract class Host implements ExtraDataHandler {
hinfo.put("enabled", isEnabled());
hinfo.put("display", getDisplayName());
hinfo.put("address", getAddress().getHostAddress());
JSONObject cinfo = new JSONObject();
JSONObject templates = new JSONObject();
for (SubCreator.ServerTemplate template : getCreator().getTemplates().values()) {
JSONObject tinfo = new JSONObject();
tinfo.put("enabled", template.isEnabled());
tinfo.put("display", template.getDisplayName());
tinfo.put("icon", template.getIcon());
tinfo.put("type", template.getType().toString());
templates.put(template.getName(), tinfo);
}
cinfo.put("templates", templates);
hinfo.put("creator", cinfo);
JSONObject servers = new JSONObject();
for (SubServer server : getSubServers().values()) {
servers.put(server.getName(), new JSONObject(server.toString()));

View File

@ -24,7 +24,6 @@ import java.io.*;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.*;
import java.util.logging.Logger;
import java.util.regex.Pattern;
/**
@ -62,7 +61,7 @@ public class InternalSubCreator extends SubCreator {
if (config.getKeys().contains("Display")) template.setDisplayName(config.getString("Display"));
}
} catch (Exception e) {
System.out.println(host.getName() + "/Creator > Couldn't load template: " + file.getName());
System.out.println(host.getName() + File.separator + "Creator > Couldn't load template: " + file.getName());
e.printStackTrace();
}
}
@ -82,19 +81,19 @@ public class InternalSubCreator extends SubCreator {
server.setAll(config);
}
} else {
System.out.println(name + "/Creator > Skipping missing template: " + other);
System.out.println(name + File.separator + "Creator > Skipping missing template: " + other);
}
}
server.setAll(template.getConfigOptions());
try {
System.out.println(name + "/Creator > Loading Template: " + template.getDisplayName());
System.out.println(name + File.separator + "Creator > Loading Template: " + template.getDisplayName());
Util.copyDirectory(template.getDirectory(), dir);
if (template.getType() == ServerType.VANILLA) {
String patch = "Patch";
if (version.compareTo(new Version("1.12")) >= 0) patch += "-v2";
version = new Version(version.toString() + " " + patch);
} else if (template.getType() == ServerType.SPONGE) {
System.out.println(name + "/Creator > Searching Versions...");
System.out.println(name + File.separator + "Creator > Searching Versions...");
Document spongexml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("http://files.minecraftforge.net/maven/org/spongepowered/spongeforge/maven-metadata.xml").openStream(), Charset.forName("UTF-8")))))));
Document forgexml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("http://files.minecraftforge.net/maven/net/minecraftforge/forge/maven-metadata.xml").openStream(), Charset.forName("UTF-8")))))));
@ -110,7 +109,7 @@ public class InternalSubCreator extends SubCreator {
}
if (spversion == null)
throw new InvalidServerException("Cannot find sponge version for Minecraft " + version.toString());
System.out.println(name + "/Creator > Found \"spongeforge-" + spversion.toString() + '"');
System.out.println(name + File.separator + "Creator > Found \"spongeforge-" + spversion.toString() + '"');
NodeList mcfnodeList = forgexml.getElementsByTagName("version");
Version mcfversion = null;
@ -124,7 +123,7 @@ public class InternalSubCreator extends SubCreator {
}
if (mcfversion == null)
throw new InvalidServerException("Cannot find forge version for Sponge " + spversion.toString());
System.out.println(name + "/Creator > Found \"forge-" + mcfversion.toString() + '"');
System.out.println(name + File.separator + "Creator > Found \"forge-" + mcfversion.toString() + '"');
version = new Version(mcfversion.toString() + " " + spversion.toString());
}
@ -139,16 +138,16 @@ public class InternalSubCreator extends SubCreator {
Process process = Runtime.getRuntime().exec("chmod " + template.getBuildOptions().getRawString("Permission") + ' ' + template.getBuildOptions().getRawString("Shell-Location"), null, dir);
Thread.sleep(500);
if (process.exitValue() != 0) {
System.out.println(name + "/Creator > Couldn't set " + template.getBuildOptions().getRawString("Permission") + " permissions to " + template.getBuildOptions().getRawString("Shell-Location"));
System.out.println(name + File.separator + "Creator > Couldn't set " + template.getBuildOptions().getRawString("Permission") + " permissions to " + template.getBuildOptions().getRawString("Shell-Location"));
}
} catch (Exception e) {
System.out.println(name + "/Creator > Couldn't set " + template.getBuildOptions().getRawString("Permission") + " permissions to " + template.getBuildOptions().getRawString("Shell-Location"));
System.out.println(name + File.separator + "Creator > Couldn't set " + template.getBuildOptions().getRawString("Permission") + " permissions to " + template.getBuildOptions().getRawString("Shell-Location"));
e.printStackTrace();
}
}
try {
System.out.println(name + "/Creator > Launching " + template.getBuildOptions().getRawString("Shell-Location"));
System.out.println(name + File.separator + "Creator > Launching " + template.getBuildOptions().getRawString("Shell-Location"));
thread.set(Runtime.getRuntime().exec((System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) ? "cmd.exe /c \"\"" + gitBash + "\" --login -i -c \"bash " + template.getBuildOptions().getRawString("Shell-Location") + ' ' + version.toString() + "\"\"" : ("bash " + template.getBuildOptions().getRawString("Shell-Location") + ' ' + version.toString() + " " + System.getProperty("user.home")), null, dir));
thread.name().log.set(host.plugin.config.get().getSection("Settings").getBoolean("Log-Creator"));
thread.name().file = new File(dir, "SubCreator-" + template.getName() + "-" + version.toString().replace(" ", "@") + ".log");
@ -176,44 +175,46 @@ public class InternalSubCreator extends SubCreator {
NamedContainer<InternalSubLogger, Process> thread = this.thread.get(name.toLowerCase()).get();
UniversalFile dir = new UniversalFile(new File(host.getPath()), name);
dir.mkdirs();
YAMLSection server;
YAMLSection server = new YAMLSection();
YAMLSection config;
try {
server = build(thread, dir, name, template, version, new LinkedList<>());
config = build(thread, dir, name, template, version, new LinkedList<>());
generateProperties(dir, port);
generateClient(dir, template.getType(), name);
} catch (SubCreatorException e) {
server = null;
config = null;
} catch (Exception e) {
server = null;
config = null;
e.printStackTrace();
}
if (server != null) {
if (config != null) {
try {
System.out.println(name + "/Creator > Saving...");
System.out.println(name + File.separator + "Creator > Saving...");
if (host.plugin.exServers.keySet().contains(name.toLowerCase())) host.plugin.exServers.remove(name.toLowerCase());
for (String option : server.getKeys()) {
if (server.isString(option)) {
server.set(option, server.getRawString(option).replace("$name$", name).replace("$template$", template.getName()).replace("$type$", template.getType().toString())
for (String option : config.getKeys()) {
if (config.isString(option)) {
config.set(option, config.getRawString(option).replace("$name$", name).replace("$template$", template.getName()).replace("$type$", template.getType().toString())
.replace("$version$", version.toString().replace(" ", "@")).replace("$port$", Integer.toString(port)));
}
}
if (!server.contains("Enabled")) server.set("Enabled", true);
if (!server.contains("Display")) server.set("Display", "");
if (!server.contains("Host")) server.set("Host", host.getName());
if (!server.contains("Group")) server.set("Group", new ArrayList<String>());
if (!server.contains("Port")) server.set("Port", port);
if (!server.contains("Motd")) server.set("Motd", "Some SubServer");
if (!server.contains("Log")) server.set("Log", true);
if (!server.contains("Directory")) server.set("Directory", "." + File.separatorChar + name);
if (!server.contains("Executable")) server.set("Executable", "java -Xmx1024M -jar " + template.getType().toString() + ".jar");
if (!server.contains("Stop-Command")) server.set("Stop-Command", "stop");
if (!server.contains("Run-On-Launch")) server.set("Run-On-Launch", false);
if (!server.contains("Auto-Restart")) server.set("Auto-Restart", false);
if (!server.contains("Restricted")) server.set("Restricted", false);
if (!server.contains("Incompatible")) server.set("Incompatible", new ArrayList<String>());
if (!server.contains("Hidden")) server.set("Hidden", false);
server.set("Enabled", true);
server.set("Display", "");
server.set("Host", host.getName());
server.set("Group", new ArrayList<String>());
server.set("Port", port);
server.set("Motd", "Some SubServer");
server.set("Log", true);
server.set("Directory", "." + File.separatorChar + name);
server.set("Executable", "java -Xmx1024M -jar " + template.getType().toString() + ".jar");
server.set("Stop-Command", "stop");
server.set("Run-On-Launch", false);
server.set("Auto-Restart", false);
server.set("Restricted", false);
server.set("Incompatible", new ArrayList<String>());
server.set("Hidden", false);
server.setAll(config);
SubServer subserver = host.addSubServer(player, name, server.getBoolean("Enabled"), port, server.getColoredString("Motd", '&'), server.getBoolean("Log"), server.getRawString("Directory"),
new Executable(server.getRawString("Executable")), server.getRawString("Stop-Command"), true, server.getBoolean("Auto-Restart"), server.getBoolean("Hidden"), server.getBoolean("Restricted"), false);
@ -226,7 +227,7 @@ public class InternalSubCreator extends SubCreator {
e.printStackTrace();
}
} else {
System.out.println(name + "/Creator > Couldn't build the server jar. Check the SubCreator logs for more detail.");
System.out.println(name + File.separator + "Creator > Couldn't build the server jar. Check the SubCreator logs for more detail.");
}
this.thread.remove(name.toLowerCase());
}
@ -400,4 +401,4 @@ public class InternalSubCreator extends SubCreator {
}
}
}
}
}

View File

@ -1,16 +1,28 @@
package net.ME1312.SubServers.Bungee.Host;
import net.ME1312.SubServers.Bungee.Library.Config.YAMLSection;
import net.ME1312.SubServers.Bungee.Library.Container;
import net.ME1312.SubServers.Bungee.Library.Exception.InvalidServerException;
import net.ME1312.SubServers.Bungee.Library.Exception.InvalidTemplateException;
import net.ME1312.SubServers.Bungee.Library.Util;
import net.ME1312.SubServers.Bungee.Library.Version.Version;
import net.ME1312.SubServers.Bungee.SubAPI;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.BufferedReader;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* SubCreator Layout Class
@ -162,6 +174,149 @@ public abstract class SubCreator {
}
}
public SubCreator() {
/*
if (!defaults) {
defaults = true;
addValidator("System", (template, match, string) -> {
boolean validated;
switch (match.toLowerCase()) {
case "touppercase":
string.set(string.get().toUpperCase());
validated = true;
break;
case "tolowercase":
string.set(string.get().toLowerCase());
validated = true;
break;
case "toserverversion":
try {
Version version = new Version(string.get());
if (template.getType() == ServerType.VANILLA) {
String patch = "Patch";
if (version.compareTo(new Version("1.12")) >= 0) patch += "-v2";
version = new Version(version.toString() + " " + patch);
} else if (template.getType() == ServerType.SPONGE) {
Document spongexml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("http://files.minecraftforge.net/maven/org/spongepowered/spongeforge/maven-metadata.xml").openStream(), Charset.forName("UTF-8")))))));
Document forgexml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("http://files.minecraftforge.net/maven/net/minecraftforge/forge/maven-metadata.xml").openStream(), Charset.forName("UTF-8")))))));
NodeList spnodeList = spongexml.getElementsByTagName("version");
Version spversion = null;
for (int i = 0; i < spnodeList.getLength(); i++) {
Node node = spnodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
if (node.getTextContent().startsWith(version.toString() + '-') && (spversion == null || new Version(node.getTextContent()).compareTo(spversion) >= 0)) {
spversion = new Version(node.getTextContent());
}
}
}
if (spversion == null)
throw new InvalidServerException("Cannot find sponge version for Minecraft " + version.toString());
NodeList mcfnodeList = forgexml.getElementsByTagName("version");
Version mcfversion = null;
for (int i = 0; i < mcfnodeList.getLength(); i++) {
Node node = mcfnodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
if (node.getTextContent().contains(spversion.toString().split("\\-")[1]) && (mcfversion == null || new Version(node.getTextContent()).compareTo(mcfversion) >= 0)) {
mcfversion = new Version(node.getTextContent());
}
}
}
if (mcfversion == null)
throw new InvalidServerException("Cannot find forge version for Sponge " + spversion.toString());
version = new Version(mcfversion.toString() + " " + spversion.toString());
}
string.set(version.toString());
validated = true;
} catch (Exception e) {
e.printStackTrace();
validated = false;
}
break;
default:
validated = false;
}
return validated;
});
addValidator("Integer", (template, match, string) -> {
Matcher matcher = Pattern.compile("^([!<>=][=]?)(.*)$").matcher(match);
String comparator = "";
String other = "";
while (matcher.find()) {
comparator = matcher.group(1).toUpperCase();
other = matcher.group(2);
}
boolean validated;
switch (comparator) {
case "=":
case "==":
validated = string.get().equals(other);
break;
case "!":
case "!=":
validated = !string.get().equals(other);
break;
case "<":
validated = new Version(string.get()).compareTo(new Version(other)) < 0;
break;
case "<=":
validated = new Version(string.get()).compareTo(new Version(other)) <= 0;
break;
case ">":
validated = new Version(string.get()).compareTo(new Version(other)) > 0;
break;
case ">=":
validated = new Version(string.get()).compareTo(new Version(other)) >= 0;
break;
default:
validated = false;
}
return validated;
});
addValidator("RegEx", (template, match, string) -> {
Matcher matcher = Pattern.compile("^/(.*)/([iux]*)$").matcher(match);
String pattern = "";
char[] flags = new char[0];
while (matcher.find()) {
pattern = matcher.group(1);
if (matcher.groupCount() >= 2)
flags = matcher.group(2).toCharArray();
}
int byteflags = 0x00;
for (char flag : flags) {
switch (flag) {
case 'i':
byteflags |= Pattern.CASE_INSENSITIVE;
break;
case 'u':
byteflags |= Pattern.UNICODE_CASE;
break;
case 'x':
byteflags |= Pattern.COMMENTS;
break;
}
}
if (byteflags == 0x00) {
matcher = Pattern.compile(pattern).matcher(match);
} else {
matcher = Pattern.compile(pattern, byteflags).matcher(match);
}
boolean validated = false;
while (matcher.find()) {
string.set(matcher.group());
validated = true;
}
return validated;
});
}
*/
}
/**
* Create a SubServer
*
@ -243,6 +398,7 @@ public abstract class SubCreator {
*/
public abstract SubLogger getLogger(String thread);
/**
* Get a list of currently reserved Server names
*

View File

@ -7,6 +7,7 @@ import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
import java.io.*;
import java.util.LinkedHashMap;
import java.util.Map;
/**
@ -31,7 +32,7 @@ public class YAMLConfig {
this.file = file;
this.yaml = new Yaml(getDumperOptions());
if (file.exists()) {
this.config = new YAMLSection((Map<String, ?>) yaml.load(new FileInputStream(file)), null, null, yaml);
this.config = new YAMLSection((LinkedHashMap<String, ?>) yaml.loadAs(new FileInputStream(file), LinkedHashMap.class), null, null, yaml);
} else {
this.config = new YAMLSection(null, null, null, yaml);
}
@ -63,7 +64,11 @@ public class YAMLConfig {
*/
@SuppressWarnings("unchecked")
public void reload() throws IOException {
config = new YAMLSection((Map<String, Object>) yaml.load(new FileInputStream(file)), null, null, yaml);
if (file.exists()) {
this.config = new YAMLSection((LinkedHashMap<String, ?>) yaml.loadAs(new FileInputStream(file), LinkedHashMap.class), null, null, yaml);
} else {
this.config = new YAMLSection(null, null, null, yaml);
}
}
/**

View File

@ -16,7 +16,7 @@ import java.util.*;
*/
@SuppressWarnings({"unchecked", "unused"})
public class YAMLSection {
protected Map<String, Object> map;
protected LinkedHashMap<String, Object> map;
protected String handle = null;
protected YAMLSection up = null;
private Yaml yaml;
@ -25,7 +25,7 @@ public class YAMLSection {
* Creates an empty YAML Section
*/
public YAMLSection() {
this.map = new HashMap<>();
this.map = new LinkedHashMap<String, Object>();
this.yaml = new Yaml(YAMLConfig.getDumperOptions());
}
@ -37,7 +37,7 @@ public class YAMLSection {
*/
public YAMLSection(InputStream stream) throws YAMLException {
if (Util.isNull(stream)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(stream);
this.map = (LinkedHashMap<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).loadAs(stream, LinkedHashMap.class);
}
/**
@ -48,7 +48,7 @@ public class YAMLSection {
*/
public YAMLSection(Reader reader) throws YAMLException {
if (Util.isNull(reader)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(reader);
this.map = (LinkedHashMap<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).loadAs(reader, LinkedHashMap.class);
}
/**
@ -58,7 +58,7 @@ public class YAMLSection {
*/
public YAMLSection(JSONObject json) {
if (Util.isNull(json)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(json.toString(4));
this.map = (LinkedHashMap<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).loadAs(json.toString(4), LinkedHashMap.class);
}
/**
@ -69,11 +69,11 @@ public class YAMLSection {
*/
public YAMLSection(String str) throws YAMLException {
if (Util.isNull(str)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(str);
this.map = (LinkedHashMap<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).loadAs(str, LinkedHashMap.class);
}
protected YAMLSection(Map<String, ?> map, YAMLSection up, String handle, Yaml yaml) {
this.map = new HashMap<String, Object>();
this.map = new LinkedHashMap<String, Object>();
this.yaml = yaml;
this.handle = handle;
this.up = up;
@ -197,6 +197,38 @@ public class YAMLSection {
if (!contains(handle)) set(handle, value);
}
/**
* Set V[] into this YAML Section
*
* @param handle Handle
* @param array Value
* @param <V> Array Type
*/
public <V> void set(String handle, V[] array) {
if (Util.isNull(handle, array)) throw new NullPointerException();
List<Object> values = new LinkedList<Object>();
for (V value : array) {
values.add(convert(value));
}
map.put(handle, values);
if (this.handle != null && this.up != null) {
this.up.set(this.handle, this);
}
}
/**
* Set V[] into this YAML Section without overwriting existing value
*
* @param handle Handle
* @param array Value
* @param <V> Array Type
*/
public <V> void safeSet(String handle, V[] array) {
if (Util.isNull(handle)) throw new NullPointerException();
if (!contains(handle)) set(handle, array);
}
/**
* Set Collection&lt;V&gt; into this YAML Section
*
@ -206,15 +238,7 @@ public class YAMLSection {
*/
public <V> void set(String handle, Collection<V> list) {
if (Util.isNull(handle, list)) throw new NullPointerException();
List<Object> values = new LinkedList<Object>();
for (V value : list) {
values.add(convert(value));
}
map.put(handle, values);
if (this.handle != null && this.up != null) {
this.up.set(this.handle, this);
}
set(handle, list.toArray());
}
/**
@ -244,15 +268,35 @@ public class YAMLSection {
/**
* Copy YAML Values to this YAML Section
*
* @param values Values
* @param values YAMLSection to merge
*/
public void setAll(YAMLSection values) {
if (Util.isNull(values)) throw new NullPointerException();
for (String value : values.map.keySet()) {
set(value, values.map.get(value));
setAll(values.map);
}
/**
* Set All Objects into this YAML Section without overwriting existing values
*
* @param values Map to set
*/
public void safeSetAll(Map<String, ?> values) {
if (Util.isNull(values)) throw new NullPointerException();
for (String value : values.keySet()) {
safeSet(value, values.get(value));
}
}
/**
* Copy YAML Values to this YAML Section without overwriting existing values
*
* @param values YAMLSection to merge
*/
public void safeSetAll(YAMLSection values) {
if (Util.isNull(values)) throw new NullPointerException();
safeSetAll(values.map);
}
/**
* Go up a level in the config (or null if this is the top layer)
*

View File

@ -10,7 +10,7 @@ Settings:
Hosts:
'~':
Enabled: true
Display: ''
Display: 'Default'
Driver: 'BUILT-IN'
Address: '127.0.0.1'
Directory: './'

View File

@ -14,7 +14,7 @@ Lang:
'Command.Generic.Console-Only': '&cSubServers &4&l\u00BB&c This command is for console use only'
'Command.Generic.Usage': '&7SubServers &8&l\u00BB&7 Usage: &f$str$'
'Command.Generic.Invalid-Subcommand': '&cSubServers &4&l\u00BB&c Unknown sub-command: $str$'
'Command.Generic.Invalid-Permission': '&cSubServers &4&l\u00BB&c You need &n$str$&4 to use this command'
'Command.Generic.Invalid-Permission': '&cSubServers &4&l\u00BB&c You need &4&n$str$&c to use this command'
'Command.Help.Header': '&7SubServers &8&l\u00BB&7 Command Help:'
'Command.Help.Help': ' &7Help:&f $str$'
'Command.Help.List': ' &7List:&f $str$'
@ -91,23 +91,23 @@ Lang:
'Interface.Host-Creator.Title': 'Host/$str$/Create'
'Interface.Host-Creator.Edit-Name': 'Change Name'
'Interface.Host-Creator.Edit-Name.Title': '&eSubCreator\n&6Enter a Name for this Server'
'Interface.Host-Creator.Edit-Name.Message': '&eSubCreator \u00BB Enter a Name for this Server via Chat'
'Interface.Host-Creator.Edit-Name.Exists': '&cSubCreator \u00BB There is already a SubServer with that name'
'Interface.Host-Creator.Edit-Name.Message': '&eSubCreator &6&l\u00BB&e Enter a Name for this Server via Chat'
'Interface.Host-Creator.Edit-Name.Exists': '&cSubCreator &4&l\u00BB&c There is already a SubServer with that name'
'Interface.Host-Creator.Edit-Name.Exists-Title': '&eSubCreator\n&cThere is already a SubServer with that name'
'Interface.Host-Creator.Edit-Name.Invalid': '&cSubCreator \u00BB Invalid Server Name'
'Interface.Host-Creator.Edit-Name.Invalid': '&cSubCreator &4&l\u00BB&c Invalid Server Name'
'Interface.Host-Creator.Edit-Name.Invalid-Title': '&eSubCreator\n&cInvalid Server Name'
'Interface.Host-Creator.Edit-Template': 'Change Server Template'
'Interface.Host-Creator.Edit-Template.Title': 'Host/$str$/Templates'
'Interface.Host-Creator.Edit-Template.No-Templates': '&c&oThere are No Templates'
'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'
'Interface.Host-Creator.Edit-Version.Unavailable': '&cSubCreator \u00BB SubCreator cannot create servers before Minecraft 1.8'
'Interface.Host-Creator.Edit-Version.Message': '&eSubCreator &6&l\u00BB&e Enter a Server Version via Chat'
'Interface.Host-Creator.Edit-Version.Unavailable': '&cSubCreator &4&l\u00BB&c SubCreator cannot create servers before Minecraft 1.8'
'Interface.Host-Creator.Edit-Version.Unavailable-Title': '&eSubCreator\n&cCannot create servers before MC 1.8'
'Interface.Host-Creator.Edit-Port': 'Change Server Port'
'Interface.Host-Creator.Edit-Port.Title': '&eSubCreator\n&6Enter a Port Number'
'Interface.Host-Creator.Edit-Port.Message': '&eSubCreator \u00BB Enter a Port Number via Chat'
'Interface.Host-Creator.Edit-Port.Invalid': '&cSubCreator \u00BB Invalid Port Number'
'Interface.Host-Creator.Edit-Port.Message': '&eSubCreator &6&l\u00BB&e Enter a Port Number via Chat'
'Interface.Host-Creator.Edit-Port.Invalid': '&cSubCreator &4&l\u00BB&c Invalid Port Number'
'Interface.Host-Creator.Edit-Port.Invalid-Title': '&eSubCreator\n&cInvalid Port Number'
'Interface.Host-Creator.Submit': '&eCreate SubServer'
'Interface.Host-Creator.Form-Incomplete': '&4Buttons above must be green'

View File

@ -11,6 +11,7 @@ import java.lang.reflect.InvocationTargetException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.nio.charset.StandardCharsets;
import java.util.*;
/**
@ -69,7 +70,7 @@ public class Client {
decoded = AES.decrypt(subdata.plugin.config.get().getSection("Settings").getSection("SubData").getRawString("Password"), Base64.getDecoder().decode(input)).get();
break;
default:
decoded = input;
decoded = new String(Base64.getDecoder().decode(input), StandardCharsets.UTF_8);
}
JSONObject json = new JSONObject(decoded);
for (PacketIn packet : SubDataServer.decodePacket(this, json)) {
@ -157,7 +158,7 @@ public class Client {
writer.println(Base64.getEncoder().encodeToString(AES.encrypt(256, subdata.plugin.config.get().getSection("Settings").getSection("SubData").getRawString("Password"), SubDataServer.encodePacket(this, packet).toString())));
break;
default:
writer.println(SubDataServer.encodePacket(this, packet));
writer.println(Base64.getEncoder().encodeToString(SubDataServer.encodePacket(this, packet).toString().getBytes(StandardCharsets.UTF_8)));
}
} catch (Throwable e) {
e.printStackTrace();

View File

@ -13,6 +13,8 @@ import net.ME1312.SubServers.Bungee.SubPlugin;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import org.json.JSONObject;
import java.util.ArrayList;
/**
* Download Host Info Packet
*/

View File

@ -262,10 +262,10 @@ public final class SubDataServer {
*/
public static void registerPacket(PacketIn packet, String handle) {
if (Util.isNull(packet, handle)) throw new NullPointerException();
List<PacketIn> list = (pIn.keySet().contains(handle))?pIn.get(handle):new ArrayList<PacketIn>();
List<PacketIn> list = (pIn.keySet().contains(handle.toLowerCase()))?pIn.get(handle.toLowerCase()):new ArrayList<PacketIn>();
if (!list.contains(packet)) {
list.add(packet);
pIn.put(handle, list);
pIn.put(handle.toLowerCase(), list);
}
}
@ -278,13 +278,13 @@ public final class SubDataServer {
if (Util.isNull(packet)) throw new NullPointerException();
List<String> search = new ArrayList<String>();
search.addAll(pIn.keySet());
for (String handle : search) if (pIn.get(handle).contains(packet)) {
List<PacketIn> list = pIn.get(handle);
for (String handle : search) if (pIn.get(handle.toLowerCase()).contains(packet)) {
List<PacketIn> list = pIn.get(handle.toLowerCase());
list.remove(packet);
if (list.isEmpty()) {
pIn.remove(handle);
pIn.remove(handle.toLowerCase());
} else {
pIn.put(handle, list);
pIn.put(handle.toLowerCase(), list);
}
}
}
@ -297,7 +297,7 @@ public final class SubDataServer {
*/
public static void registerPacket(Class<? extends PacketOut> packet, String handle) {
if (Util.isNull(packet, handle)) throw new NullPointerException();
pOut.put(packet, handle);
pOut.put(packet, handle.toLowerCase());
}
/**
@ -318,7 +318,7 @@ public final class SubDataServer {
*/
public static List<? extends PacketIn> getPacket(String handle) {
if (Util.isNull(handle)) throw new NullPointerException();
return new ArrayList<PacketIn>(pIn.get(handle));
return new ArrayList<PacketIn>(pIn.get(handle.toLowerCase()));
}
/**

View File

@ -299,7 +299,7 @@ public final class SubCommand extends Command implements TabExecutor {
sender.sendMessage("SubServers > Usage: " + label + " " + args[0].toLowerCase() + " <SubServer> <Command> [Args...]");
}
} else if (args[0].equalsIgnoreCase("sudo") || args[0].equalsIgnoreCase("screen")) {
if (args[0].length() > 1) {
if (args.length > 1) {
Map<String, Server> servers = plugin.api.getServers();
if (!args[1].equals("*") && !servers.keySet().contains(args[1].toLowerCase())) {
sender.sendMessage("SubServers > There is no server with that name");

View File

@ -1,17 +1,11 @@
package net.ME1312.SubServers.Bungee;
import net.ME1312.SubServers.Bungee.Event.SubStoppedEvent;
import net.ME1312.SubServers.Bungee.Host.Executable;
import net.ME1312.SubServers.Bungee.Host.Server;
import net.ME1312.SubServers.Bungee.Host.*;
import net.ME1312.SubServers.Bungee.Library.*;
import net.ME1312.SubServers.Bungee.Library.Config.YAMLConfig;
import net.ME1312.SubServers.Bungee.Library.Exception.InvalidHostException;
import net.ME1312.SubServers.Bungee.Library.Exception.InvalidServerException;
import net.ME1312.SubServers.Bungee.Host.Host;
import net.ME1312.SubServers.Bungee.Host.SubServer;
import net.ME1312.SubServers.Bungee.Library.Metrics;
import net.ME1312.SubServers.Bungee.Library.NamedContainer;
import net.ME1312.SubServers.Bungee.Library.UniversalFile;
import net.ME1312.SubServers.Bungee.Library.Util;
import net.ME1312.SubServers.Bungee.Library.Version.Version;
import net.ME1312.SubServers.Bungee.Network.SubDataServer;
import net.md_5.bungee.BungeeCord;
@ -294,7 +288,88 @@ public final class SubPlugin extends BungeeCord implements Listener {
}
System.out.println("SubServers > " + ((plugins > 0)?plugins+" Plugin"+((plugins == 1)?"":"s")+", ":"") + hosts + " Host"+((hosts == 1)?"":"s")+", " + servers + " Server"+((servers == 1)?"":"s")+", and " + subservers + " SubServer"+((subservers == 1)?"":"s")+" loaded in " + new DecimalFormat("0.000").format((Calendar.getInstance().getTime().getTime() - begin) / 1000D) + "s");
/*
System.out.println(" ");
System.out.println("// Begin Internal SubCreator Template Argument Validator Tests //");
Container<String> str = new Container<String>("testString");
SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "System", "toUppercase", str);
System.out.println("System.toUppercase: testString -> " + str.get());
str.set("testString");
SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "System", "toLowercase", str);
System.out.println("System.toLowercase: testString -> " + str.get());
str.set("1.8");
SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "System", "toServerVersion", str);
System.out.println("System.toServerVersion: 1.8 -> " + str.get());
str.set("1.10.2");
SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "System", "toServerVersion", str);
System.out.println("System.toServerVersion: 1.10.2 -> " + str.get());
str.set("1.12.2");
SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "System", "toServerVersion", str);
System.out.println("System.toServerVersion: 1.12.2 -> " + str.get());
str.set("1.8");
System.out.println("Integer: " + str.get() + " == 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "=1.10.2", str))?"TRUE":"FALSE"));
str.set("1.10.2");
System.out.println("Integer: " + str.get() + " == 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "==1.10.2", str))?"TRUE":"FALSE"));
str.set("1.8");
System.out.println("Integer: " + str.get() + " != 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "!1.10.2", str))?"TRUE":"FALSE"));
str.set("1.10.2");
System.out.println("Integer: " + str.get() + " != 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "!=1.10.2", str))?"TRUE":"FALSE"));
str.set("1.8");
System.out.println("Integer: " + str.get() + " < 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "<1.10.2", str))?"TRUE":"FALSE"));
str.set("1.10.2");
System.out.println("Integer: " + str.get() + " < 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "<1.10.2", str))?"TRUE":"FALSE"));
str.set("1.12.2");
System.out.println("Integer: " + str.get() + " < 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "<1.10.2", str))?"TRUE":"FALSE"));
str.set("1.8");
System.out.println("Integer: " + str.get() + " <= 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "<=1.10.2", str))?"TRUE":"FALSE"));
str.set("1.10.2");
System.out.println("Integer: " + str.get() + " <= 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "<=1.10.2", str))?"TRUE":"FALSE"));
str.set("1.12.2");
System.out.println("Integer: " + str.get() + " <= 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", "<=1.10.2", str))?"TRUE":"FALSE"));
str.set("1.8");
System.out.println("Integer: " + str.get() + " > 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", ">1.10.2", str))?"TRUE":"FALSE"));
str.set("1.10.2");
System.out.println("Integer: " + str.get() + " > 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", ">1.10.2", str))?"TRUE":"FALSE"));
str.set("1.12.2");
System.out.println("Integer: " + str.get() + " > 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", ">1.10.2", str))?"TRUE":"FALSE"));
str.set("1.8");
System.out.println("Integer: " + str.get() + " >= 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", ">=1.10.2", str))?"TRUE":"FALSE"));
str.set("1.10.2");
System.out.println("Integer: " + str.get() + " >= 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", ">=1.10.2", str))?"TRUE":"FALSE"));
str.set("1.12.2");
System.out.println("Integer: " + str.get() + " >= 1.10.2 = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "Integer", ">=1.10.2", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /No Pizza Please/ == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/No Pizza Please/", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /no pizza please/ == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/no pizza please/", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /nopizzaplease/ == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/nopizzaplease/", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /No Pizza Please/i == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/No Pizza Please/i", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /no pizza please/i == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/no pizza please/i", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /nopizzaplease/i == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/nopizzaplease/i", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /No Pizza Please/u == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/No Pizza Please/u", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /no pizza please/u == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/no pizza please/u", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /nopizzaplease/u == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/nopizzaplease/u", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /No Pizza Please/x == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/No Pizza Please/x", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /no pizza please/x == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/no pizza please/x", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /nopizzaplease/x == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/nopizzaplease/x", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /No Pizza Please/iux == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/No Pizza Please/iux", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /no pizza please/iux == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/no pizza please/iux", str))?"TRUE":"FALSE"));
str.set("No Pizza Please");
System.out.println("RegEx: /nopizzaplease/iux == " + str.get() + " = " + ((SubCreator.validate(((Host) api.getHosts().values().toArray()[0]).getCreator().getTemplate("Sponge"), "RegEx", "/nopizzaplease/iux", str))?"TRUE":"FALSE"));
System.out.println(" ");
*/
super.startListeners();
if (!posted) {
post();

Binary file not shown.

View File

@ -338,11 +338,9 @@ public class InternalUIRenderer extends UIRenderer {
public void hostCreator(final CreatorOptions options) {
setDownloading(ChatColor.stripColor(plugin.lang.getSection("Lang").getColoredString("Interface.Host-Creator.Title", '&').replace("$str$", options.getHost())));
lastVisitedObjects[0] = options;
if (!options.init()) {
if (!options.init())
windowHistory.add(() -> hostCreator(options));
lastVisitedObjects[0] = options.getHost();
}
lastVisitedObjects[0] = options;
plugin.subdata.sendPacket(new PacketDownloadHostInfo(options.getHost(), json -> {
if (!json.getBoolean("valid")|| !json.getJSONObject("host").getBoolean("enabled")) {

View File

@ -10,6 +10,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
/**
@ -34,7 +35,7 @@ public class YAMLConfig {
this.file = file;
this.yaml = new Yaml(getDumperOptions());
if (file.exists()) {
this.config = new YAMLSection((Map<String, ?>) yaml.load(new FileInputStream(file)), null, null, yaml);
this.config = new YAMLSection((LinkedHashMap<String, ?>) yaml.loadAs(new FileInputStream(file), LinkedHashMap.class), null, null, yaml);
} else {
this.config = new YAMLSection(null, null, null, yaml);
}
@ -66,7 +67,11 @@ public class YAMLConfig {
*/
@SuppressWarnings("unchecked")
public void reload() throws IOException {
config = new YAMLSection((Map<String, Object>) yaml.load(new FileInputStream(file)), null, null, yaml);
if (file.exists()) {
this.config = new YAMLSection((LinkedHashMap<String, ?>) yaml.loadAs(new FileInputStream(file), LinkedHashMap.class), null, null, yaml);
} else {
this.config = new YAMLSection(null, null, null, yaml);
}
}
/**

View File

@ -16,7 +16,7 @@ import java.util.*;
*/
@SuppressWarnings({"unchecked", "unused"})
public class YAMLSection {
protected Map<String, Object> map;
protected LinkedHashMap<String, Object> map;
protected String handle = null;
protected YAMLSection up = null;
private Yaml yaml;
@ -25,7 +25,7 @@ public class YAMLSection {
* Creates an empty YAML Section
*/
public YAMLSection() {
this.map = new HashMap<>();
this.map = new LinkedHashMap<String, Object>();
this.yaml = new Yaml(YAMLConfig.getDumperOptions());
}
@ -37,7 +37,7 @@ public class YAMLSection {
*/
public YAMLSection(InputStream stream) throws YAMLException {
if (Util.isNull(stream)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(stream);
this.map = (LinkedHashMap<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).loadAs(stream, LinkedHashMap.class);
}
/**
@ -48,7 +48,7 @@ public class YAMLSection {
*/
public YAMLSection(Reader reader) throws YAMLException {
if (Util.isNull(reader)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(reader);
this.map = (LinkedHashMap<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).loadAs(reader, LinkedHashMap.class);
}
/**
@ -58,7 +58,7 @@ public class YAMLSection {
*/
public YAMLSection(JSONObject json) {
if (Util.isNull(json)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(json.toString(4));
this.map = (LinkedHashMap<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).loadAs(json.toString(4), LinkedHashMap.class);
}
/**
@ -69,11 +69,11 @@ public class YAMLSection {
*/
public YAMLSection(String str) throws YAMLException {
if (Util.isNull(str)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(str);
this.map = (LinkedHashMap<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).loadAs(str, LinkedHashMap.class);
}
protected YAMLSection(Map<String, ?> map, YAMLSection up, String handle, Yaml yaml) {
this.map = new HashMap<String, Object>();
this.map = new LinkedHashMap<String, Object>();
this.yaml = yaml;
this.handle = handle;
this.up = up;
@ -197,6 +197,38 @@ public class YAMLSection {
if (!contains(handle)) set(handle, value);
}
/**
* Set V[] into this YAML Section
*
* @param handle Handle
* @param array Value
* @param <V> Array Type
*/
public <V> void set(String handle, V[] array) {
if (Util.isNull(handle, array)) throw new NullPointerException();
List<Object> values = new LinkedList<Object>();
for (V value : array) {
values.add(convert(value));
}
map.put(handle, values);
if (this.handle != null && this.up != null) {
this.up.set(this.handle, this);
}
}
/**
* Set V[] into this YAML Section without overwriting existing value
*
* @param handle Handle
* @param array Value
* @param <V> Array Type
*/
public <V> void safeSet(String handle, V[] array) {
if (Util.isNull(handle)) throw new NullPointerException();
if (!contains(handle)) set(handle, array);
}
/**
* Set Collection&lt;V&gt; into this YAML Section
*
@ -206,15 +238,7 @@ public class YAMLSection {
*/
public <V> void set(String handle, Collection<V> list) {
if (Util.isNull(handle, list)) throw new NullPointerException();
List<Object> values = new LinkedList<Object>();
for (V value : list) {
values.add(convert(value));
}
map.put(handle, values);
if (this.handle != null && this.up != null) {
this.up.set(this.handle, this);
}
set(handle, list.toArray());
}
/**
@ -244,15 +268,35 @@ public class YAMLSection {
/**
* Copy YAML Values to this YAML Section
*
* @param values Values
* @param values YAMLSection to merge
*/
public void setAll(YAMLSection values) {
if (Util.isNull(values)) throw new NullPointerException();
for (String value : values.map.keySet()) {
set(value, values.map.get(value));
setAll(values.map);
}
/**
* Set All Objects into this YAML Section without overwriting existing values
*
* @param values Map to set
*/
public void safeSetAll(Map<String, ?> values) {
if (Util.isNull(values)) throw new NullPointerException();
for (String value : values.keySet()) {
safeSet(value, values.get(value));
}
}
/**
* Copy YAML Values to this YAML Section without overwriting existing values
*
* @param values YAMLSection to merge
*/
public void safeSetAll(YAMLSection values) {
if (Util.isNull(values)) throw new NullPointerException();
safeSetAll(values.map);
}
/**
* Go up a level in the config (or null if this is the top layer)
*

View File

@ -19,6 +19,7 @@ import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.nio.charset.StandardCharsets;
import java.util.*;
/**
@ -128,7 +129,7 @@ public final class SubDataClient {
decoded = AES.decrypt(plugin.config.get().getSection("Settings").getSection("SubData").getRawString("Password"), Base64.getDecoder().decode(input)).get();
break;
default:
decoded = input;
decoded = new String(Base64.getDecoder().decode(input), StandardCharsets.UTF_8);
}
JSONObject json = new JSONObject(decoded);
for (PacketIn packet : decodePacket(json)) {
@ -199,10 +200,10 @@ public final class SubDataClient {
*/
public static void registerPacket(PacketIn packet, String handle) {
if (Util.isNull(packet, handle)) throw new NullPointerException();
List<PacketIn> list = (pIn.keySet().contains(handle))?pIn.get(handle):new ArrayList<PacketIn>();
List<PacketIn> list = (pIn.keySet().contains(handle.toLowerCase()))?pIn.get(handle.toLowerCase()):new ArrayList<PacketIn>();
if (!list.contains(packet)) {
list.add(packet);
pIn.put(handle, list);
pIn.put(handle.toLowerCase(), list);
}
}
@ -215,13 +216,13 @@ public final class SubDataClient {
if (Util.isNull(packet)) throw new NullPointerException();
List<String> search = new ArrayList<String>();
search.addAll(pIn.keySet());
for (String handle : search) if (pIn.get(handle).contains(packet)) {
List<PacketIn> list = pIn.get(handle);
for (String handle : search) if (pIn.get(handle.toLowerCase()).contains(packet)) {
List<PacketIn> list = pIn.get(handle.toLowerCase());
list.remove(packet);
if (list.isEmpty()) {
pIn.remove(handle);
pIn.remove(handle.toLowerCase());
} else {
pIn.put(handle, list);
pIn.put(handle.toLowerCase(), list);
}
}
}
@ -234,7 +235,7 @@ public final class SubDataClient {
*/
public static void registerPacket(Class<? extends PacketOut> packet, String handle) {
if (Util.isNull(packet, handle)) throw new NullPointerException();
pOut.put(packet, handle);
pOut.put(packet, handle.toLowerCase());
}
/**
@ -255,7 +256,7 @@ public final class SubDataClient {
*/
public static List<? extends PacketIn> getPacket(String handle) {
if (Util.isNull(handle)) throw new NullPointerException();
return new ArrayList<PacketIn>(pIn.get(handle));
return new ArrayList<PacketIn>(pIn.get(handle.toLowerCase()));
}
/**
@ -288,7 +289,7 @@ public final class SubDataClient {
writer.println(Base64.getEncoder().encodeToString(AES.encrypt(256, plugin.config.get().getSection("Settings").getSection("SubData").getRawString("Password"), json.toString())));
break;
default:
writer.println(json.toString());
writer.println(Base64.getEncoder().encodeToString(json.toString().getBytes(StandardCharsets.UTF_8)));
}
} catch (Throwable e) {
e.printStackTrace();

View File

@ -11,11 +11,19 @@ import net.ME1312.SubServers.Client.Bukkit.Network.SubDataClient;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.json.JSONObject;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.*;
import java.net.InetAddress;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.concurrent.TimeUnit;
/**
* SubServers Client Plugin Class
@ -27,7 +35,7 @@ public final class SubPlugin extends JavaPlugin {
public UIHandler gui = null;
public final Version version;
public final Version bversion = new Version(1);
public final Version bversion = new Version(2);
public final SubAPI api = new SubAPI(this);
public SubPlugin() {
@ -81,6 +89,26 @@ public final class SubPlugin extends JavaPlugin {
getCommand("subserver").setExecutor(cmd);
getCommand("sub").setExecutor(cmd);
}
Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
try {
Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("http://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Client.Bukkit/maven-metadata.xml").openStream(), Charset.forName("UTF-8")))))));
NodeList updnodeList = updxml.getElementsByTagName("version");
Version updversion = version;
int updcount = -1;
for (int i = 0; i < updnodeList.getLength(); i++) {
Node node = updnodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) {
updversion = new Version(node.getTextContent());
updcount++;
}
}
}
if (!updversion.equals(version)) System.out.println("SubServers > SubServers.Client.Bukkit v" + updversion + " is available. You are " + updcount + " version" + ((updcount == 1)?"":"s") + " behind.");
} catch (Exception e) {}
}, 0, TimeUnit.DAYS.toSeconds(2) * 20);
} catch (IOException e) {
setEnabled(false);
e.printStackTrace();

Binary file not shown.

View File

@ -54,7 +54,7 @@ public final class ExHost {
public SubDataClient subdata = null;
public final Version version = new Version("2.12.2a");
public final Version bversion = new Version(1);
public final Version bversion = new Version(2);
public final SubAPI api = new SubAPI(this);
private boolean running;

View File

@ -7,6 +7,7 @@ import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
import java.io.*;
import java.util.LinkedHashMap;
import java.util.Map;
/**
@ -31,7 +32,7 @@ public class YAMLConfig {
this.file = file;
this.yaml = new Yaml(getDumperOptions());
if (file.exists()) {
this.config = new YAMLSection((Map<String, ?>) yaml.load(new FileInputStream(file)), null, null, yaml);
this.config = new YAMLSection((LinkedHashMap<String, ?>) yaml.loadAs(new FileInputStream(file), LinkedHashMap.class), null, null, yaml);
} else {
this.config = new YAMLSection(null, null, null, yaml);
}
@ -63,7 +64,11 @@ public class YAMLConfig {
*/
@SuppressWarnings("unchecked")
public void reload() throws IOException {
config = new YAMLSection((Map<String, Object>) yaml.load(new FileInputStream(file)), null, null, yaml);
if (file.exists()) {
this.config = new YAMLSection((LinkedHashMap<String, ?>) yaml.loadAs(new FileInputStream(file), LinkedHashMap.class), null, null, yaml);
} else {
this.config = new YAMLSection(null, null, null, yaml);
}
}
/**

View File

@ -197,6 +197,38 @@ public class YAMLSection {
if (!contains(handle)) set(handle, value);
}
/**
* Set V[] into this YAML Section
*
* @param handle Handle
* @param array Value
* @param <V> Array Type
*/
public <V> void set(String handle, V[] array) {
if (Util.isNull(handle, array)) throw new NullPointerException();
List<Object> values = new LinkedList<Object>();
for (V value : array) {
values.add(convert(value));
}
map.put(handle, values);
if (this.handle != null && this.up != null) {
this.up.set(this.handle, this);
}
}
/**
* Set V[] into this YAML Section without overwriting existing value
*
* @param handle Handle
* @param array Value
* @param <V> Array Type
*/
public <V> void safeSet(String handle, V[] array) {
if (Util.isNull(handle)) throw new NullPointerException();
if (!contains(handle)) set(handle, array);
}
/**
* Set Collection&lt;V&gt; into this YAML Section
*
@ -206,15 +238,7 @@ public class YAMLSection {
*/
public <V> void set(String handle, Collection<V> list) {
if (Util.isNull(handle, list)) throw new NullPointerException();
List<Object> values = new LinkedList<Object>();
for (V value : list) {
values.add(convert(value));
}
map.put(handle, values);
if (this.handle != null && this.up != null) {
this.up.set(this.handle, this);
}
set(handle, list.toArray());
}
/**
@ -244,15 +268,35 @@ public class YAMLSection {
/**
* Copy YAML Values to this YAML Section
*
* @param values Values
* @param values YAMLSection to merge
*/
public void setAll(YAMLSection values) {
if (Util.isNull(values)) throw new NullPointerException();
for (String value : values.map.keySet()) {
set(value, values.map.get(value));
setAll(values.map);
}
/**
* Set All Objects into this YAML Section without overwriting existing values
*
* @param values Map to set
*/
public void safeSetAll(Map<String, ?> values) {
if (Util.isNull(values)) throw new NullPointerException();
for (String value : values.keySet()) {
safeSet(value, values.get(value));
}
}
/**
* Copy YAML Values to this YAML Section without overwriting existing values
*
* @param values YAMLSection to merge
*/
public void safeSetAll(YAMLSection values) {
if (Util.isNull(values)) throw new NullPointerException();
safeSetAll(values.map);
}
/**
* Go up a level in the config (or null if this is the top layer)
*

View File

@ -22,6 +22,7 @@ import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -151,7 +152,7 @@ public final class SubDataClient {
decoded = AES.decrypt(host.config.get().getSection("Settings").getSection("SubData").getRawString("Password"), Base64.getDecoder().decode(input)).get();
break;
default:
decoded = input;
decoded = new String(Base64.getDecoder().decode(input), StandardCharsets.UTF_8);
}
JSONObject json = new JSONObject(decoded);
for (PacketIn packet : decodePacket(json)) {
@ -220,9 +221,11 @@ public final class SubDataClient {
*/
public static void registerPacket(PacketIn packet, String handle) {
if (Util.isNull(packet, handle)) throw new NullPointerException();
List<PacketIn> list = (pIn.keySet().contains(handle))?pIn.get(handle):new ArrayList<PacketIn>();
if (!list.contains(packet)) list.add(packet);
pIn.put(handle, list);
List<PacketIn> list = (pIn.keySet().contains(handle.toLowerCase()))?pIn.get(handle.toLowerCase()):new ArrayList<PacketIn>();
if (!list.contains(packet)) {
list.add(packet);
pIn.put(handle.toLowerCase(), list);
}
}
/**
@ -232,7 +235,17 @@ public final class SubDataClient {
*/
public static void unregisterPacket(PacketIn packet) {
if (Util.isNull(packet)) throw new NullPointerException();
for (String handle : pIn.keySet()) if (pIn.get(handle).contains(packet)) pIn.get(handle).remove(packet);
List<String> search = new ArrayList<String>();
search.addAll(pIn.keySet());
for (String handle : search) if (pIn.get(handle.toLowerCase()).contains(packet)) {
List<PacketIn> list = pIn.get(handle.toLowerCase());
list.remove(packet);
if (list.isEmpty()) {
pIn.remove(handle.toLowerCase());
} else {
pIn.put(handle.toLowerCase(), list);
}
}
}
/**
@ -243,7 +256,7 @@ public final class SubDataClient {
*/
public static void registerPacket(Class<? extends PacketOut> packet, String handle) {
if (Util.isNull(packet, handle)) throw new NullPointerException();
pOut.put(packet, handle);
pOut.put(packet, handle.toLowerCase());
}
/**
@ -264,7 +277,7 @@ public final class SubDataClient {
*/
public static List<? extends PacketIn> getPacket(String handle) {
if (Util.isNull(handle)) throw new NullPointerException();
return new ArrayList<PacketIn>(pIn.get(handle));
return new ArrayList<PacketIn>(pIn.get(handle.toLowerCase()));
}
/**
@ -297,7 +310,7 @@ public final class SubDataClient {
writer.println(Base64.getEncoder().encodeToString(AES.encrypt(256, host.config.get().getSection("Settings").getSection("SubData").getRawString("Password"), json.toString())));
break;
default:
writer.println(json.toString());
writer.println(Base64.getEncoder().encodeToString(json.toString().getBytes(StandardCharsets.UTF_8)));
}
} catch (Throwable e) {
log.error.println(e);

View File

@ -2,4 +2,4 @@ Manifest-Version: 1.0
Class-Path: BungeeCord.jar
Main-Class: net.ME1312.SubServers.Sync.Launch
Implementation-Version: 2.12.2a
Specification-Version: 1
Specification-Version: 2

Binary file not shown.

View File

@ -7,6 +7,7 @@ import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
import java.io.*;
import java.util.LinkedHashMap;
import java.util.Map;
/**
@ -31,7 +32,7 @@ public class YAMLConfig {
this.file = file;
this.yaml = new Yaml(getDumperOptions());
if (file.exists()) {
this.config = new YAMLSection((Map<String, ?>) yaml.load(new FileInputStream(file)), null, null, yaml);
this.config = new YAMLSection((LinkedHashMap<String, ?>) yaml.loadAs(new FileInputStream(file), LinkedHashMap.class), null, null, yaml);
} else {
this.config = new YAMLSection(null, null, null, yaml);
}
@ -63,7 +64,11 @@ public class YAMLConfig {
*/
@SuppressWarnings("unchecked")
public void reload() throws IOException {
config = new YAMLSection((Map<String, Object>) yaml.load(new FileInputStream(file)), null, null, yaml);
if (file.exists()) {
this.config = new YAMLSection((LinkedHashMap<String, ?>) yaml.loadAs(new FileInputStream(file), LinkedHashMap.class), null, null, yaml);
} else {
this.config = new YAMLSection(null, null, null, yaml);
}
}
/**

View File

@ -71,7 +71,7 @@ public class YAMLSection {
if (Util.isNull(str)) throw new NullPointerException();
this.map = (Map<String, Object>) (this.yaml = new Yaml(YAMLConfig.getDumperOptions())).load(str);
}
protected YAMLSection(Map<String, ?> map, YAMLSection up, String handle, Yaml yaml) {
this.map = new HashMap<String, Object>();
this.yaml = yaml;
@ -197,6 +197,38 @@ public class YAMLSection {
if (!contains(handle)) set(handle, value);
}
/**
* Set V[] into this YAML Section
*
* @param handle Handle
* @param array Value
* @param <V> Array Type
*/
public <V> void set(String handle, V[] array) {
if (Util.isNull(handle, array)) throw new NullPointerException();
List<Object> values = new LinkedList<Object>();
for (V value : array) {
values.add(convert(value));
}
map.put(handle, values);
if (this.handle != null && this.up != null) {
this.up.set(this.handle, this);
}
}
/**
* Set V[] into this YAML Section without overwriting existing value
*
* @param handle Handle
* @param array Value
* @param <V> Array Type
*/
public <V> void safeSet(String handle, V[] array) {
if (Util.isNull(handle)) throw new NullPointerException();
if (!contains(handle)) set(handle, array);
}
/**
* Set Collection&lt;V&gt; into this YAML Section
*
@ -206,15 +238,7 @@ public class YAMLSection {
*/
public <V> void set(String handle, Collection<V> list) {
if (Util.isNull(handle, list)) throw new NullPointerException();
List<Object> values = new LinkedList<Object>();
for (V value : list) {
values.add(convert(value));
}
map.put(handle, values);
if (this.handle != null && this.up != null) {
this.up.set(this.handle, this);
}
set(handle, list.toArray());
}
/**
@ -244,15 +268,35 @@ public class YAMLSection {
/**
* Copy YAML Values to this YAML Section
*
* @param values Values
* @param values YAMLSection to merge
*/
public void setAll(YAMLSection values) {
if (Util.isNull(values)) throw new NullPointerException();
for (String value : values.map.keySet()) {
set(value, values.map.get(value));
setAll(values.map);
}
/**
* Set All Objects into this YAML Section without overwriting existing values
*
* @param values Map to set
*/
public void safeSetAll(Map<String, ?> values) {
if (Util.isNull(values)) throw new NullPointerException();
for (String value : values.keySet()) {
safeSet(value, values.get(value));
}
}
/**
* Copy YAML Values to this YAML Section without overwriting existing values
*
* @param values YAMLSection to merge
*/
public void safeSetAll(YAMLSection values) {
if (Util.isNull(values)) throw new NullPointerException();
safeSetAll(values.map);
}
/**
* Go up a level in the config (or null if this is the top layer)
*

View File

@ -22,6 +22,7 @@ import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -145,7 +146,7 @@ public final class SubDataClient {
decoded = AES.decrypt(plugin.config.get().getSection("Settings").getSection("SubData").getRawString("Password"), Base64.getDecoder().decode(input)).get();
break;
default:
decoded = input;
decoded = new String(Base64.getDecoder().decode(input), StandardCharsets.UTF_8);
}
JSONObject json = new JSONObject(decoded);
for (PacketIn packet : decodePacket(json)) {
@ -205,10 +206,10 @@ public final class SubDataClient {
*/
public static void registerPacket(PacketIn packet, String handle) {
if (Util.isNull(packet, handle)) throw new NullPointerException();
List<PacketIn> list = (pIn.keySet().contains(handle))?pIn.get(handle):new ArrayList<PacketIn>();
List<PacketIn> list = (pIn.keySet().contains(handle.toLowerCase()))?pIn.get(handle.toLowerCase()):new ArrayList<PacketIn>();
if (!list.contains(packet)) {
list.add(packet);
pIn.put(handle, list);
pIn.put(handle.toLowerCase(), list);
}
}
@ -221,13 +222,13 @@ public final class SubDataClient {
if (Util.isNull(packet)) throw new NullPointerException();
List<String> search = new ArrayList<String>();
search.addAll(pIn.keySet());
for (String handle : search) if (pIn.get(handle).contains(packet)) {
List<PacketIn> list = pIn.get(handle);
for (String handle : search) if (pIn.get(handle.toLowerCase()).contains(packet)) {
List<PacketIn> list = pIn.get(handle.toLowerCase());
list.remove(packet);
if (list.isEmpty()) {
pIn.remove(handle);
pIn.remove(handle.toLowerCase());
} else {
pIn.put(handle, list);
pIn.put(handle.toLowerCase(), list);
}
}
}
@ -240,7 +241,7 @@ public final class SubDataClient {
*/
public static void registerPacket(Class<? extends PacketOut> packet, String handle) {
if (Util.isNull(packet, handle)) throw new NullPointerException();
pOut.put(packet, handle);
pOut.put(packet, handle.toLowerCase());
}
/**
@ -261,7 +262,7 @@ public final class SubDataClient {
*/
public static List<? extends PacketIn> getPacket(String handle) {
if (Util.isNull(handle)) throw new NullPointerException();
return new ArrayList<PacketIn>(pIn.get(handle));
return new ArrayList<PacketIn>(pIn.get(handle.toLowerCase()));
}
/**
@ -294,7 +295,7 @@ public final class SubDataClient {
writer.println(Base64.getEncoder().encodeToString(AES.encrypt(256, plugin.config.get().getSection("Settings").getSection("SubData").getRawString("Password"), json.toString())));
break;
default:
writer.println(json.toString());
writer.println(Base64.getEncoder().encodeToString(json.toString().getBytes(StandardCharsets.UTF_8)));
}
} catch (Throwable e) {
e.printStackTrace();