beautified default peer names

pull/402/head
Michael Peter Christen 4 years ago
parent a9befbba5f
commit baad56d83d

@ -16,9 +16,6 @@ port.ssl = 8443
# port to listen for a shutdown signal ( -1 = disable use of a shutdown port, 8005 = recommended default )
port.shutdown = -1
# prefix for new default peer names
peernameprefix=_anon
# use UPnP [true/false]
upnp.enabled = true
# remote host on UPnP device (for more than one connection)

@ -92,7 +92,7 @@ import net.yacy.utils.crypt;
public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>
{
public static String ANON_PREFIX = "_anon";
public static String ANON_PREFIX = "agent";
public static final int maxsize = 16000;
/**
@ -319,10 +319,17 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>
* @return
*/
private static String defaultPeerName() {
return ANON_PREFIX
+ OS.infoKey()
Random r = new Random(System.currentTimeMillis());
char[] n = new char[7];
for (int i = 0; i < 7; i++) {
n[i] = i % 2 == 1 ? "aeiou".charAt(r.nextInt(5)) : "bdfghklmnprst".charAt(r.nextInt(13));
}
return
ANON_PREFIX
+ "-"
+ (System.currentTimeMillis() % 77777777L)
+ new String(n)
+ "-"
+ OS.infoKey()
+ "-"
+ Network.speedKey;
}

@ -340,9 +340,6 @@ public final class Switchboard extends serverSwitch {
setLog(new ConcurrentLog("SWITCHBOARD"));
AccessTracker.setDumpFile(new File(dataPath, "DATA/LOG/queries.log"));
// set default peer name
Seed.ANON_PREFIX = getConfig("peernameprefix", "_anon");
// set timeoutrequests
boolean timeoutrequests = getConfigBool("timeoutrequests", true);
TimeoutRequest.enable = timeoutrequests;

Loading…
Cancel
Save