public GameServer(boolean autorun) {
if (autorun) {
if (m_boolGui) {
createGui();
}
loadSettings();
} else if (m_boolGui) {
loadSettings();
createGui();
} else {
ConsoleReader r = new ConsoleReader();
System.out.println("Load Settings? Y/N");
String answer = r.readToken();
if ((answer.contains("y")) || (answer.contains("Y"))) {
loadSettings();
} else {
getConsoleSettings();
}
}
start();
}
public void updatePlayerCount() {
if (m_boolGui) {
int amount = ActiveConnections.getActiveConnections();
this.m_pAmount.setText(amount + " players online");
if (amount > this.m_highest) {
this.m_highest = amount;
this.m_pHighest.setText("Highest: " + amount);
}
} else {
int amount = ActiveConnections.getActiveConnections();
System.out.println(amount + " players online");
if (amount > this.m_highest) {
this.m_highest = amount;
System.out.println("Highest: " + amount);
}
}
}
public static String getDatabaseHost() {
return m_dbServer;
}
public static String getDatabaseName() {
return m_dbName;
}
public static String getDatabasePassword() {
return m_dbPassword;
}
public static String getDatabaseUsername() {
return m_dbUsername;
}
public static GameServer getInstance() {
return m_instance;
}
public static void initGameServer(boolean autorun) {
m_instance = new GameServer(autorun);
}
public static int getMaxPlayers() {
return m_maxPlayers;
}
public static int getPort() {
return m_port;
}
public static String getServerName() {
return m_serverName;
}
public static ServiceManager getServiceManager() {
return m_serviceManager;
}
public static void main(String[] args) {
try {
PrintStream p = new PrintStream(new File("./errors.txt"));
System.setErr(p);
} catch (Exception e) {
e.printStackTrace();
}
Options options = new Options();
options.addOption("p", "players", true, "Sets the max number of players.");
options.addOption("port", "port", true, "Sets the serverport.");
options.addOption("ng", "nogui", false, "Starts server in headless mode.");
options.addOption("ar", "autorun", false, "Runs without asking a single question.");
options.addOption("h", "help", false, "Shows this menu.");
options.addOption("rates", "serverrates", true, "Gives the file to be used for server rates config");
if (args.length > 0) {
CommandLineParser parser = new GnuParser();
try {
CommandLine line = parser.parse(options, args);
if (line.hasOption("players")) {
m_maxPlayers = Integer.parseInt(line.getOptionValue("players"));
if (m_maxPlayers < 1) {
m_maxPlayers = 500;
}
}
if (line.hasOption("port")) {
m_port = Integer.parseInt(line.getOptionValue("port"));
}
if (line.hasOption("help")) {
HelpFormatter formatter = new HelpFormatter();
System.err.println("Server requires a settings parameter");
formatter.printHelp("java GameServer [param] <args>", options);
}
if (!line.hasOption("nogui")) {
m_boolGui = true;
}
if (line.hasOption("rates")) {
String rates = line.getOptionValue("rates");
Ini ratesIni = new Ini(new FileInputStream(rates));
Ini.Section s = (Ini.Section) ratesIni.get("RATES");
RATE_GOLD = Double.parseDouble((String) s.get("GOLD"));
RATE_EXP_POKE = Double.parseDouble((String) s.get("EXP_POKE"));
RATE_EXP_TRAINER = Double.parseDouble((String) s.get("EXP_TRAINER"));
}
this.m_dbP = new JPasswordField();
this.m_dbP.setSize(128, 24);
this.m_dbP.setText("Pass");
this.m_dbP.setLocation(4, 224);
this.m_gui.getContentPane().add(this.m_dbP);
this.m_name = new JTextField();
this.m_name.setSize(128, 24);
this.m_name.setText("Your Server Name");
this.m_name.setLocation(4, 260);
this.m_gui.getContentPane().add(this.m_name);
File f = new File("res/settings.txt");
if (f.exists()) {
try {
Scanner s = new Scanner(f);
this.m_dbS.setText(s.nextLine());
this.m_dbN.setText(s.nextLine());
this.m_dbU.setText(s.nextLine());
this.m_dbP.setText(s.nextLine());
this.m_name.setText(s.nextLine());
s.close();
} catch (Exception e) {
e.printStackTrace();
}
}
this.m_gui.setVisible(true);
}
private void exit() {
if ((m_boolGui) && (this.m_stop.isEnabled())) {
JOptionPane.showMessageDialog(null, "You must stop the server before exiting.");
} else {
MySqlManager.getInstance().close();
System.exit(0);
}
}
private void getConsoleSettings() {
ConsoleReader r = new ConsoleReader();
System.out.println("Please enter the required information.");
System.out.println("Database Server: ");
m_dbServer = r.readToken();
System.out.println("Database Name:");
m_dbName = r.readToken();
System.out.println("Database Username:");
m_dbUsername = r.readToken();
System.out.println("Database Password:");
m_dbPassword = r.readToken();
System.out.println("This server's IP or hostname:");
m_serverName = r.readToken();
System.out.println("Save info? (Y/N)");
String answer = r.readToken();
if ((answer.contains("y")) || (answer.contains("Y"))) {
saveSettings();
}
System.out.println();
System.err.println("WARNING: When using -nogui, the server should only be shut down using a master client");
}
Since pokenet is licensed as GNU open source, they must keep their project based on pokenet open source as well, that is the law
(but they don't)
29-09-13
Tobalinator
Re: [Release]pokenet+pokemonium (server+client)
link download for this version ?? i don't see on the first post...
29-09-13
Lucila
Re: [Release]pokenet+pokemonium (server+client)
ask to xkl. He is the pro cracker.
29-09-13
viperpray
Re: [Release]pokenet+pokemonium (server+client)
Quote:
Originally Posted by tanomist
Since pokenet is licensed as GNU open source, they must keep their project based on pokenet open source as well, that is the law
(but they don't)
Till the game is out of beta legally we don't have to release anything google uses this method to not release source code for gnu licences as well.
03-10-13
Lucila
Re: [Release]pokenet+pokemonium (server+client)
I I have these files [server + client pokemonium 1.6] in my possession.
I want them to share with you. I have only one request. That someone, create a program to edit pokemon, trainer, items in the accounts of the players. That's it!
I promise to share the source of the server and client.