mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-14 11:39:17 +01:00
Fixed some small things
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
class FortniteVersion {
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
32
lib/src/model/server_type.dart
Normal file
32
lib/src/model/server_type.dart
Normal 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";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user