update private server stuff to not break all the fucking time
This commit is contained in:
@@ -70,24 +70,24 @@ public class PrivateServerPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
if (RuneLite.allowPrivateServer)
|
||||
if (!RuneLite.allowPrivateServer)
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
if (!config.modulus().equals(""))
|
||||
{
|
||||
client.setModulus(new BigInteger("83ff79a3e258b99ead1a70e1049883e78e513c4cdec538d8da9483879a9f81689c0c7d146d7b82b52d05cf26132b1cda5930eeef894e4ccf3d41eebc3aabe54598c4ca48eb5a31d736bfeea17875a35558b9e3fcd4aebe2a9cc970312a477771b36e173dc2ece6001ab895c553e2770de40073ea278026f36961c94428d8d7db", 16));
|
||||
client.setModulus(new BigInteger(config.modulus(), 16));
|
||||
}
|
||||
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
if (RuneLite.allowPrivateServer)
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
client.setModulus(null);
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
@@ -97,12 +97,19 @@ public class PrivateServerPlugin extends Plugin
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("privateserver") && event.getKey().equals("modulus"))
|
||||
if (!event.getGroup().equals("privateserver"))
|
||||
{
|
||||
client.setModulus(new BigInteger(config.modulus(), 16));
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getGroup().equals("privateserver") && event.getKey().equals("codebase"))
|
||||
if (event.getKey().equals("modulus"))
|
||||
{
|
||||
if (RuneLite.allowPrivateServer && !config.modulus().equals(""))
|
||||
{
|
||||
client.setModulus(new BigInteger(config.modulus(), 16));
|
||||
}
|
||||
}
|
||||
else if (event.getKey().equals("codebase"))
|
||||
{
|
||||
StringFileUtils.writeStringToFile(RuneLite.RUNELITE_DIR + "/codebase", config.codebase());
|
||||
String message = "Client restart required after codebase change\n";
|
||||
@@ -110,12 +117,4 @@ public class PrivateServerPlugin extends Plugin
|
||||
JOptionPane.WARNING_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateConfig()
|
||||
{
|
||||
if (!config.modulus().equals(""))
|
||||
{
|
||||
client.setModulus(new BigInteger(config.modulus(), 16));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user