mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-07 16:49:11 +00:00
[BUGFIX] Generating a new mac
They block the login with `empty_mac` so I’m generating a new mac.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package org.parabot.randoms.dreamscape;
|
package org.parabot.randoms.dreamscape;
|
||||||
|
|
||||||
import org.parabot.core.Context;
|
import org.parabot.core.Context;
|
||||||
|
import org.parabot.core.network.NetworkInterface;
|
||||||
import org.parabot.environment.randoms.RandomType;
|
import org.parabot.environment.randoms.RandomType;
|
||||||
import org.parabot.randoms.utils.Reflection;
|
import org.parabot.randoms.utils.Reflection;
|
||||||
|
|
||||||
@@ -9,9 +10,6 @@ import org.parabot.randoms.utils.Reflection;
|
|||||||
*/
|
*/
|
||||||
public class MacAddressAvoider implements org.parabot.environment.randoms.Random {
|
public class MacAddressAvoider implements org.parabot.environment.randoms.Random {
|
||||||
|
|
||||||
private static final String MAC_ADDRESS_FIELD = "MAC_ADDRESS";
|
|
||||||
private static final String MAC_ADDRESS_VALUE = "empty_mac";
|
|
||||||
|
|
||||||
private boolean done;
|
private boolean done;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -21,7 +19,9 @@ public class MacAddressAvoider implements org.parabot.environment.randoms.Random
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
Reflection.workAroundStaticValues(Context.getInstance().getClient().getClass(), MAC_ADDRESS_FIELD, MAC_ADDRESS_VALUE);
|
byte[] mac = new byte[6];
|
||||||
|
new java.util.Random().nextBytes(mac);
|
||||||
|
Reflection.workAroundStaticValues(Context.getInstance().getClient().getClass(), "MAC_ADDRESS", NetworkInterface.formatMac(mac));
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user