Make project setup easier with Maven (#411)

* Remove a bunch of .ideas and class files to see if it makes the setup easier

* remove some .idea's and imkls

* Remove a ton of .class files

* [TASK] Switched to maven instead of gradle

* [TASK] Added target to gitignore

* Remove ignored files

* [TASK] Fixed file_server source

* [TASK] Fixed client source

* [BUGFIX] Main Class

* [BUGFIX] Fixed SLF4J

* [TASK] Server Libs cleanup

* Update setup guide/debug

* Maven cli compile instructions

* [TASK] Jar building

* Update runServer and runFileServer.sh

Co-authored-by: Sandro Coutinho <sandro@farrelltech.org>
This commit is contained in:
Daniel Ginovker
2020-08-04 17:57:19 -04:00
committed by GitHub
parent 6684364b64
commit eebc60084f
1811 changed files with 61630 additions and 63947 deletions
@@ -1,70 +1,70 @@
package com.rebotted.console;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.Scanner;
import com.rebotted.GameConstants;
import com.rebotted.console.commands.ListPlayers;
import com.rebotted.console.commands.Stop;
/**
*
* @author RS-Emulators
*
*/
public class CommandConsole implements Runnable {
private static CommandConsole cc;
private Thread self;
private Scanner scanner;
// Lazy, not intending to add runtime class loading.
private ArrayList<CommandProcessor> cmds = new ArrayList<CommandProcessor>();
private CommandConsole() {
cmds.add(new ListPlayers());
cmds.add(new Stop());
scanner = new Scanner(System.in);
cc = this;
self = new Thread(cc);
self.start();
}
@Override
public void run() {
System.out.println("Welcome to " + GameConstants.SERVER_NAME + ".");
while (true) {
System.out.print("> ");
String input = null;
try {
input = scanner.nextLine();
String[] splited = input.split("\\s+");
if (splited[0].isEmpty()) {
System.out.println("Command not recognized. Try 'help'.");
continue;
}
if (splited[0].equalsIgnoreCase("help")) {
for (CommandProcessor cmd : cmds) {
System.out.println(cmd.help());
}
continue;
}
for (CommandProcessor cmd : cmds) {
if (cmd.command(splited)) {
break;
}
}
} catch (NoSuchElementException | NullPointerException e) {
}
}
}
public static CommandConsole getInstance() {
if (cc == null) {
cc = new CommandConsole();
}
return cc;
}
}
package com.rebotted.console;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.Scanner;
import com.rebotted.GameConstants;
import com.rebotted.console.commands.ListPlayers;
import com.rebotted.console.commands.Stop;
/**
*
* @author RS-Emulators
*
*/
public class CommandConsole implements Runnable {
private static CommandConsole cc;
private Thread self;
private Scanner scanner;
// Lazy, not intending to add runtime class loading.
private ArrayList<CommandProcessor> cmds = new ArrayList<CommandProcessor>();
private CommandConsole() {
cmds.add(new ListPlayers());
cmds.add(new Stop());
scanner = new Scanner(System.in);
cc = this;
self = new Thread(cc);
self.start();
}
@Override
public void run() {
System.out.println("Welcome to " + GameConstants.SERVER_NAME + ".");
while (true) {
System.out.print("> ");
String input = null;
try {
input = scanner.nextLine();
String[] splited = input.split("\\s+");
if (splited[0].isEmpty()) {
System.out.println("Command not recognized. Try 'help'.");
continue;
}
if (splited[0].equalsIgnoreCase("help")) {
for (CommandProcessor cmd : cmds) {
System.out.println(cmd.help());
}
continue;
}
for (CommandProcessor cmd : cmds) {
if (cmd.command(splited)) {
break;
}
}
} catch (NoSuchElementException | NullPointerException e) {
}
}
}
public static CommandConsole getInstance() {
if (cc == null) {
cc = new CommandConsole();
}
return cc;
}
}
@@ -1,13 +1,13 @@
package com.rebotted.console;
/**
*
* @author RS-Emulators
*
*/
public interface CommandProcessor {
public boolean command(String[] cmd);
public String help();
}
package com.rebotted.console;
/**
*
* @author RS-Emulators
*
*/
public interface CommandProcessor {
public boolean command(String[] cmd);
public String help();
}
@@ -1,31 +1,31 @@
package com.rebotted.console.commands;
import com.rebotted.console.CommandProcessor;
import com.rebotted.game.players.Player;
import com.rebotted.game.players.PlayerHandler;
/**
*
* @author RS-Emulators
*
*/
public class ListPlayers implements CommandProcessor {
@Override
public boolean command(String[] cmd) {
if (!cmd[0].equalsIgnoreCase("list")) {
return false;
}
System.out.println("Currently online: " + PlayerHandler.getPlayerCount());
for (Player p : PlayerHandler.players) {
System.out.print(p.playerName + ",");
}
return true;
}
@Override
public String help() {
return "list - lists online players.";
}
}
package com.rebotted.console.commands;
import com.rebotted.console.CommandProcessor;
import com.rebotted.game.players.Player;
import com.rebotted.game.players.PlayerHandler;
/**
*
* @author RS-Emulators
*
*/
public class ListPlayers implements CommandProcessor {
@Override
public boolean command(String[] cmd) {
if (!cmd[0].equalsIgnoreCase("list")) {
return false;
}
System.out.println("Currently online: " + PlayerHandler.getPlayerCount());
for (Player p : PlayerHandler.players) {
System.out.print(p.playerName + ",");
}
return true;
}
@Override
public String help() {
return "list - lists online players.";
}
}
@@ -1,28 +1,28 @@
package com.rebotted.console.commands;
import com.rebotted.GameEngine;
import com.rebotted.console.CommandProcessor;
/**
*
* @author RS-Emulators
*
*/
public class Stop implements CommandProcessor {
@Override
public boolean command(String[] cmd) {
if (!cmd[0].equalsIgnoreCase("stop")) {
return false;
}
System.out.println("Setting shutdown flag to true...");
GameEngine.shutdownServer = true;
return true;
}
@Override
public String help() {
return "stop - sets GameEngine.shutdownServer to true.";
}
}
package com.rebotted.console.commands;
import com.rebotted.GameEngine;
import com.rebotted.console.CommandProcessor;
/**
*
* @author RS-Emulators
*
*/
public class Stop implements CommandProcessor {
@Override
public boolean command(String[] cmd) {
if (!cmd[0].equalsIgnoreCase("stop")) {
return false;
}
System.out.println("Setting shutdown flag to true...");
GameEngine.shutdownServer = true;
return true;
}
@Override
public String help() {
return "stop - sets GameEngine.shutdownServer to true.";
}
}