mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 11:12:23 +01:00
<feat: New release>
This commit is contained in:
@@ -5,7 +5,7 @@ class GameInstance {
|
||||
final int gamePid;
|
||||
final int? launcherPid;
|
||||
final int? eacPid;
|
||||
int? watchPid;
|
||||
int? observerPid;
|
||||
bool hosting;
|
||||
bool tokenError;
|
||||
bool linkedHosting;
|
||||
@@ -14,14 +14,27 @@ class GameInstance {
|
||||
: tokenError = false,
|
||||
assert(!linkedHosting || !hosting, "Only a game instance can have a linked hosting server");
|
||||
|
||||
GameInstance.fromJson(Map<String, dynamic>? json) :
|
||||
gamePid = json?["game"] ?? -1,
|
||||
launcherPid = json?["launcher"],
|
||||
eacPid = json?["eac"],
|
||||
watchPid = json?["watchPid"],
|
||||
hosting = json?["hosting"] ?? false,
|
||||
tokenError = json?["tokenError"] ?? false,
|
||||
linkedHosting = json?["linkedHosting"] ?? false;
|
||||
GameInstance._fromJson(this.gamePid, this.launcherPid, this.eacPid, this.observerPid,
|
||||
this.hosting, this.tokenError, this.linkedHosting);
|
||||
|
||||
static GameInstance? fromJson(Map<String, dynamic>? json) {
|
||||
if(json == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var gamePid = json["game"];
|
||||
if(gamePid == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var launcherPid = json["launcher"];
|
||||
var eacPid = json["eac"];
|
||||
var observerPid = json["observer"];
|
||||
var hosting = json["hosting"];
|
||||
var tokenError = json["tokenError"];
|
||||
var linkedHosting = json["linkedHosting"];
|
||||
return GameInstance._fromJson(gamePid, launcherPid, eacPid, observerPid, hosting, tokenError, linkedHosting);
|
||||
}
|
||||
|
||||
void kill() {
|
||||
Process.killPid(gamePid, ProcessSignal.sigabrt);
|
||||
@@ -31,8 +44,8 @@ class GameInstance {
|
||||
if(eacPid != null) {
|
||||
Process.killPid(eacPid!, ProcessSignal.sigabrt);
|
||||
}
|
||||
if(watchPid != null) {
|
||||
Process.killPid(watchPid!, ProcessSignal.sigabrt);
|
||||
if(observerPid != null) {
|
||||
Process.killPid(observerPid!, ProcessSignal.sigabrt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +53,7 @@ class GameInstance {
|
||||
'game': gamePid,
|
||||
'launcher': launcherPid,
|
||||
'eac': eacPid,
|
||||
'watch': watchPid,
|
||||
'observer': observerPid,
|
||||
'hosting': hosting,
|
||||
'tokenError': tokenError,
|
||||
'linkedHosting': linkedHosting
|
||||
|
||||
@@ -7,6 +7,12 @@ class ServerResult {
|
||||
}
|
||||
|
||||
enum ServerResultType {
|
||||
starting,
|
||||
startSuccess,
|
||||
startError,
|
||||
stopping,
|
||||
stopSuccess,
|
||||
stopError,
|
||||
missingHostError,
|
||||
missingPortError,
|
||||
illegalPortError,
|
||||
@@ -15,9 +21,7 @@ enum ServerResultType {
|
||||
freePortError,
|
||||
pingingRemote,
|
||||
pingingLocal,
|
||||
pingError,
|
||||
startSuccess,
|
||||
startError;
|
||||
pingError;
|
||||
|
||||
bool get isError => name.contains("Error");
|
||||
}
|
||||
Reference in New Issue
Block a user