Start implementing the server backend
This commit is contained in:
parent
617b3f938c
commit
9716a4ab24
2 changed files with 31 additions and 3 deletions
6
server/src/main/java/dev/zontreck/vorpal/Settings.java
Normal file
6
server/src/main/java/dev/zontreck/vorpal/Settings.java
Normal file
|
@ -0,0 +1,6 @@
|
|||
package dev.zontreck.vorpal;
|
||||
|
||||
public class Settings
|
||||
{
|
||||
public static int PORT_NUMBER;
|
||||
}
|
|
@ -3,12 +3,34 @@
|
|||
*/
|
||||
package dev.zontreck.vorpal;
|
||||
|
||||
import dev.zontreck.ariaslib.args.Arguments;
|
||||
import dev.zontreck.ariaslib.args.ArgumentsParser;
|
||||
import dev.zontreck.ariaslib.args.IntegerArgument;
|
||||
|
||||
public class VorpalServer {
|
||||
public String getGreeting() {
|
||||
return "Hello World!";
|
||||
public static final Arguments DEFAULT_ARGS;
|
||||
static {
|
||||
|
||||
DEFAULT_ARGS = new Arguments();
|
||||
DEFAULT_ARGS.setArg(new IntegerArgument("port", 1588));
|
||||
}
|
||||
|
||||
private static void log(String... args)
|
||||
{
|
||||
for(String str : args)
|
||||
{
|
||||
System.out.print(str);
|
||||
}
|
||||
|
||||
System.out.print("\n");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(new VorpalServer().getGreeting());
|
||||
Arguments active = ArgumentsParser.parseArguments(args, DEFAULT_ARGS);
|
||||
|
||||
Settings.PORT_NUMBER = (int)active.getArg("port").getValue();
|
||||
|
||||
log("Port number set to: ", String.valueOf(Settings.PORT_NUMBER));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue