Created
February 21, 2016 17:23
-
-
Save mschlumpp/fb6c63383c54f8a5a4a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 8ba9a80b5bea3ed72e7ebf5821ee41d969a709c7 Mon Sep 17 00:00:00 2001 | |
From: Marco Schlumpp <marco.schlumpp@gmail.com> | |
Date: Sun, 21 Feb 2016 18:15:04 +0100 | |
Subject: [PATCH] Ignore buggy scripts preventing votekicks. | |
Make sure a buggy votekick "extension" cannot prevent votekicks by | |
throwing exceptions. The ratio script throws an unexpected exception if | |
the player name has a certain format. | |
--- | |
feature_server/scripts/votekick.py | 6 +++++- | |
1 file changed, 5 insertions(+), 1 deletion(-) | |
diff --git a/feature_server/scripts/votekick.py b/feature_server/scripts/votekick.py | |
index ed163f7..5b61276 100644 | |
--- a/feature_server/scripts/votekick.py | |
+++ b/feature_server/scripts/votekick.py | |
@@ -143,7 +143,11 @@ class Votekick(object): | |
elif REQUIRE_REASON and not reason: | |
raise VotekickFailure(S_NEED_REASON) | |
- result = protocol.on_votekick_start(instigator, victim, reason) | |
+ result = None | |
+ try: | |
+ result = protocol.on_votekick_start(instigator, victim, reason) | |
+ except Exception as e: | |
+ print "Buggy on_votekick_start handler threw an unexpected exception: {}".format(repr(e)) | |
if result is not None: | |
raise VotekickFailure(result) | |
-- | |
2.7.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment