1 from email.mime.text
import MIMEText
7 desc = Crossfire.ScriptParameters()
9 pl.Message(
"To report an issue, type 'report <description of the issue>'.")
13 'PLAYER': Crossfire.WhoAmI().Name,
14 'MAP': Crossfire.WhoAmI().Map.Path,
15 'X': Crossfire.WhoAmI().X,
16 'Y': Crossfire.WhoAmI().Y,
26 Crossfire.Log(Crossfire.LogInfo,
"A problem was reported: %s" % (report))
28 msg = MIMEText(report)
29 recipient =
"crossfire"
30 msg[
"From"] =
"crossfire"
31 msg[
"Subject"] =
"Crossfire issue report"
34 result = subprocess.run([
'sendmail', recipient], universal_newlines=
True, input=msg.as_string(), timeout=2)
35 if result.returncode == 0:
36 pl.Message(
"Thank you for your report.")
39 except subprocess.TimeoutExpired:
41 Crossfire.Log(Crossfire.LogError,
"Timed out while reporting a problem")
44 pl.Message(
"There was an error reporting your problem. Please try again or contact a Dungeon Master to report your problem.")