Permalink
Browse files

Some improvements to crash handler:

- Admins have access to /crashnoted, which will restore battling and chatting, but won't declare the crash fixed (since only sysops can fix bugs)
- /crashnoted and /crashfixed will automatically fail if PS is not in a lockdown state
  • Loading branch information...
1 parent 052057f commit f2ea2ec225bdaf14f10c6ced0cb718842bdc7d9d @Zarel committed May 4, 2012
Showing with 20 additions and 1 deletion.
  1. +20 −1 chat-commands.js
View
@@ -1005,14 +1005,33 @@ function parseCommandLocal(user, cmd, target, room, socket, message) {
break;
case 'crashfixed':
+ if (!lockdown) {
+ socket.emit('console', '/crashfixed - There is no active crash.');
+ return false;
+ }
if (!user.can('hotpatch')) {
socket.emit('console', '/crashfixed - Access denied.');
return false;
}
lockdown = false;
config.modchat = false;
- rooms.lobby.addRaw('<div style="background-color:#6688AA;color:white;padding:2px 4px"><b>We fixed the crash without restarting the server!</b><br />You may resume talking in the lobby and starting new battles.</div>');
+ rooms.lobby.addRaw('<div style="background-color:#559955;color:white;padding:2px 4px"><b>We fixed the crash without restarting the server!</b><br />You may resume talking in the lobby and starting new battles.</div>');
+ return false;
+ break;
+ case 'crashnoted':
+ if (!lockdown) {
+ socket.emit('console', '/crashnoted - There is no active crash.');
+ return false;
+ }
+ if (!user.can('announce')) {
+ socket.emit('console', '/crashnoted - Access denied.');
+ return false;
+ }
+
+ lockdown = false;
+ config.modchat = false;
+ rooms.lobby.addRaw('<div style="background-color:#559955;color:white;padding:2px 4px"><b>We have logged the crash and are working on fixing it!</b><br />You may resume talking in the lobby and starting new battles.</div>');
return false;
break;

0 comments on commit f2ea2ec

Please sign in to comment.