fun createFromCommandline(args: Array<String>): Profile? { val profile = Profile() var i = 0 while (i != args.size) { if (args[i] == "-u") { profile.setUser(args[i + 1])} else if (args[i] == "-p") { profile.setPassword(args[i + 1]) } else if (args[i] == "-c") { profile.setCharacter(args[i + 1]) } else if (args[i] == "-h") { profile.setHost(args[i + 1]) } else if (args[i] == "-P") { profile.setPort(args[i + 1].toInt()) } else if (args[i] == "-S") { profile.setSeed(args[i + 1]) } i++ } if (profile.getCharacter() == null) { profile.setCharacter(profile.getUser()) } return profile }
create a profile based on command line arguments < ul > < li > -u : username < /li > < li > -p : password < /li > < li > -c : character name ( defaults to username ) < /li > < li > -h : hostname < /li > < li > -P : port < /li > < li > -S : pre authentication seed < /li > < /ul >