Fixed some small things

This commit is contained in:
Alessandro Autiero
2022-10-16 02:08:01 +02:00
parent 968739de9e
commit 699367200f
147 changed files with 953 additions and 54005 deletions

View File

@@ -1,6 +1,5 @@
import 'dart:io';
import 'package:path/path.dart' as path;
class FortniteVersion {

View File

@@ -1,5 +1,32 @@
enum GameType {
client,
server,
headlessServer
headlessServer;
static GameType? of(String id){
try {
return GameType.values
.firstWhere((element) => element.id == id);
}catch(_){
return null;
}
}
String get id {
return this == GameType.client ? "client"
: this == GameType.server ? "server"
: "headless_server";
}
String get name {
return this == GameType.client ? "Client"
: this == GameType.server ? "Server"
: "Headless Server";
}
String get message {
return this == GameType.client ? "A fortnite client will be launched to play multiplayer games"
: this == GameType.server ? "A fortnite client will be launched to host multiplayer games"
: "A fortnite client will be launched in the background to host multiplayer games";
}
}

View File

@@ -0,0 +1,32 @@
enum ServerType {
embedded,
remote,
local;
static ServerType? of(String id){
try {
return ServerType.values
.firstWhere((element) => element.id == id);
}catch(_){
return null;
}
}
String get id {
return this == ServerType.embedded ? "embedded"
: this == ServerType.remote ? "remote"
: "local";
}
String get name {
return this == ServerType.embedded ? "Embedded"
: this == ServerType.remote ? "Remote"
: "Local";
}
String get message {
return this == ServerType.embedded ? "A server will be automatically started in the background"
: this == ServerType.remote ? "A reverse proxy to the remote server will be created"
: "Assumes that you are running yourself the server locally";
}
}