There HAS to be a better way to do this! :) There probably already is... have a close look at the API...
On Sat, May 06, 2006 at 11:41:42AM +0000, [EMAIL PROTECTED] wrote: > Modified: trunk/freenet/src/freenet/node/TextModeClientInterface.java > =================================================================== > --- trunk/freenet/src/freenet/node/TextModeClientInterface.java > 2006-05-06 10:54:28 UTC (rev 8619) > +++ trunk/freenet/src/freenet/node/TextModeClientInterface.java > 2006-05-06 11:40:33 UTC (rev 8620) > @@ -27,6 +27,8 @@ > import freenet.client.InsertBlock; > import freenet.client.InserterException; > import freenet.client.events.EventDumper; > +import freenet.config.Option; > +import freenet.config.SubConfig; > import freenet.crypt.RandomSource; > import freenet.io.comm.Peer; > import freenet.io.comm.PeerParseException; > @@ -564,7 +566,27 @@ > while(key.length() > 0 && key.charAt(key.length()-1) == ' ') > key = key.substring(0, key.length()-2); > outsb.append("New name: "+key); > - n.setName(key); > + SubConfig[] sc=n.config.getConfigs(); > + > + for(int i=0; i<sc.length ; i++){ > + Option[] o = sc[i].getOptions(); > + String prefix = new String(sc[i].getPrefix()); > + String configName; > + > + for(int j=0; j<o.length; j++){ > + configName=o[j].getName(); > + // we look for node.name > + if(prefix.equals("node") && > configName.equals("name")){ > + Logger.minor(this, "Setting > "+prefix+"."+configName+" to "+key); > + try{ > + o[j].setValue(key); > + }catch(Exception e){ > + Logger.error(this, > "Error setting node's name"); > + } > + } > + } > + } > + n.config.store(); > } else if(uline.startsWith("DISCONNECT:")) { > String ipAndPort = line.substring("DISCONNECT:".length()); > disconnect(ipAndPort.trim()); > > _______________________________________________ > cvs mailing list > cvs@freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > -- Matthew J Toseland - [EMAIL PROTECTED] Freenet Project Official Codemonkey - http://freenetproject.org/ ICTHUS - Nothing is impossible. Our Boss says so.
signature.asc
Description: Digital signature
_______________________________________________ Devl mailing list Devl@freenetproject.org http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl