Start implementing the server backend

This commit is contained in:
Zontreck 2024-02-10 15:20:31 -07:00
parent 617b3f938c
commit 9716a4ab24
2 changed files with 31 additions and 3 deletions

View file

@ -0,0 +1,6 @@
package dev.zontreck.vorpal;
public class Settings
{
public static int PORT_NUMBER;
}

View file

@ -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));
}
}