Crossfire Server, Trunk
report.py
Go to the documentation of this file.
1 from email.mime.text import MIMEText
2 import subprocess
3 
4 import Crossfire
5 
6 def report(pl):
7  desc = Crossfire.ScriptParameters()
8  if desc == None:
9  pl.Message("To report an issue, type 'report <description of the issue>'.")
10  return
11 
12  details = {
13  'PLAYER': Crossfire.WhoAmI().Name,
14  'MAP': Crossfire.WhoAmI().Map.Path,
15  'X': Crossfire.WhoAmI().X,
16  'Y': Crossfire.WhoAmI().Y,
17  'DESC': desc,
18  }
19 
20  report = """
21 Reporter: {PLAYER}
22 Map: {MAP} ({X}, {Y})
23 Report: {DESC}
24 """.format(**details)
25 
26  Crossfire.Log(Crossfire.LogInfo, "A problem was reported: %s" % (report))
27 
28  msg = MIMEText(report)
29  recipient = "crossfire"
30  msg["From"] = "crossfire"
31  msg["Subject"] = "Crossfire issue report"
32 
33  try:
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.")
37  else:
38  error(pl)
39  except subprocess.TimeoutExpired:
40  error(pl)
41  Crossfire.Log(Crossfire.LogError, "Timed out while reporting a problem")
42 
43 def error(pl):
44  pl.Message("There was an error reporting your problem. Please try again or contact a Dungeon Master to report your problem.")
45 
46 report(Crossfire.WhoAmI())
report.report
def report(pl)
Definition: report.py:6
report
Definition: report.py:1
format
Python Guilds Quick outline Add a guild(mapmakers) this is still a problem *after dropping the token to gain access to the stove a woodfloor now appears which is Toolshed Token(found in Guild_HQ) *Note also have multiple gates in place to protect players and items from the mana explosion drop x for Jewelers room *Jewelers room works just need to determine what x is drop x for Thaumaturgy room *Thaumaturgy room works just need to determine what x is drop gold dropping the Firestar named fearless allows access to but I suspect that the drop location of the chest is not as intended because the player is in the way once you enter the chest the exit back to the basement is things such as the message et al reside on teleporters which then transport items to the map as they are when the map is already purchased items reappear in that area From my this does not cause any problems at the moment But this should be corrected fixed Major it s now possible to buy guilds Ryo Update Uploaded guild package to CVS Changes the cauldrons and the charging room I spent a while agonizing over They were natural guild enhancements but much too much value for any reasonable expense to buy them Then I thought that they should be pay access but at a greatly reduced rate SO when you buy a forge or whatever for your guild it is available on a perplayer daily rate but it will be accessable for testing and to DMs to play with Like I said lots still to do with the especially comingt up with quest items for buying things like the new workshops and stuff One of the things I would like some input on would be proposals for additional fields for either the guildhouses or guild datafiles to play with Currently the Guildhouse but there is no reason we can t have more than one measure of a guild perhaps have dues relate to Dues and use points for some other suspended or inactive or when a guild is founded inactive active Guilds have the format
Definition: README.txt:140
report.error
def error(pl)
Definition: report.py:43