Add a delay for disabling mods in bulk
This commit is contained in:
parent
b2a7493539
commit
3b7876532b
10 changed files with 57 additions and 39 deletions
|
@ -106,12 +106,12 @@ class C2SLoginPacket implements IPacket {
|
|||
// Attempt to log in.
|
||||
Settings settings = Settings();
|
||||
|
||||
if (settings.superuser!.login(username, password)) {
|
||||
if (settings.superuser.login(username, password)) {
|
||||
settings.remoteLoginToken = UUID.generate(4);
|
||||
loginReply.valid = true;
|
||||
loginReply.token = settings.remoteLoginToken;
|
||||
|
||||
settings.superuser!.sendDiscordActionLog("Login Success");
|
||||
settings.superuser.sendDiscordActionLog("Login Success");
|
||||
|
||||
settings.loggedInUser = settings.superuser;
|
||||
} else {
|
||||
|
@ -121,7 +121,7 @@ class C2SLoginPacket implements IPacket {
|
|||
// Properly handle the disabled account
|
||||
if (loginReply.valid && username == "_disabled") loginReply.valid = false;
|
||||
|
||||
if (!loginReply.valid && settings.superuser!.name != username) {
|
||||
if (!loginReply.valid && settings.superuser.name != username) {
|
||||
// Check for a lower level user
|
||||
if (settings.inst!.admins.any((T) => T.name == username)) {
|
||||
User theUser =
|
||||
|
@ -358,12 +358,20 @@ class C2SUploadSettingsPacket implements IPacket {
|
|||
// Send a webhook with all the mods listed
|
||||
String modListText = "";
|
||||
for (var entry in settings.inst!.mods) {
|
||||
modListText += "${entry.mod_name}\n";
|
||||
if (entry.enabled) modListText += "${entry.mod_name}\n";
|
||||
}
|
||||
|
||||
modListText = modListText.trim();
|
||||
DiscordHookHelper.sendWebHook(settings.inst!.discord,
|
||||
DiscordHookProps.INACTIVE, "Mod List", modListText);
|
||||
if (modListText.isEmpty) {
|
||||
DiscordHookHelper.sendWebHook(
|
||||
settings.inst!.discord,
|
||||
DiscordHookProps.INACTIVE,
|
||||
"Mod List",
|
||||
"The Server is currently vanilla");
|
||||
} else {
|
||||
DiscordHookHelper.sendWebHook(settings.inst!.discord,
|
||||
DiscordHookProps.INACTIVE, "Mod List", modListText);
|
||||
}
|
||||
|
||||
// Check if server is running, if not, stop immediately
|
||||
// If server is running, schedule restart for 1 minute and send a alert to all players, then perform stop or restart depending on if running in Pterodactyl Compatibility mode
|
||||
|
@ -456,7 +464,7 @@ class C2SRequestCreateBackup implements IPacket {
|
|||
world.copy(pth.build());
|
||||
|
||||
settings.loggedInUser!
|
||||
.sendDiscordActionLog("Created a new backup named ${fileName}");
|
||||
.sendDiscordActionLog("Created a new backup named $fileName");
|
||||
}
|
||||
|
||||
return PacketResponse.nil;
|
||||
|
@ -651,7 +659,7 @@ class C2SRequestSnapshotDeletion implements IPacket {
|
|||
ph.deleteFile();
|
||||
|
||||
settings.loggedInUser!.sendDiscordActionLog(
|
||||
"Requested snapshot deletion of backup named: ${snapshotName}");
|
||||
"Requested snapshot deletion of backup named: $snapshotName");
|
||||
|
||||
return PacketResponse.nil;
|
||||
}
|
||||
|
@ -714,7 +722,7 @@ class C2SRequestWorldRestore implements IPacket {
|
|||
SessionData.CURRENT_INTERVAL = WarnIntervals.NONE;
|
||||
|
||||
settings.loggedInUser!.sendDiscordActionLog(
|
||||
"Requested world restore, and initiated a immediate restart. World restored: ${snapshot}");
|
||||
"Requested world restore, and initiated a immediate restart. World restored: $snapshot");
|
||||
|
||||
return PacketResponse.nil;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue