Python cleanup
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@19887 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
91339595cc
commit
e35d5a504d
|
|
@ -8,36 +8,35 @@ opened, check the player's mail and create objects if necessary.
|
||||||
import Crossfire
|
import Crossfire
|
||||||
import CFMail
|
import CFMail
|
||||||
|
|
||||||
activator=Crossfire.WhoIsActivator()
|
activator = Crossfire.WhoIsActivator()
|
||||||
activatorname=activator.Name
|
|
||||||
whoami=Crossfire.WhoAmI()
|
|
||||||
|
|
||||||
mail = CFMail.CFMail()
|
mail = CFMail.CFMail()
|
||||||
total = mail.countmail(activatorname)
|
whoami = Crossfire.WhoAmI()
|
||||||
|
|
||||||
|
total = mail.countmail(activator.Name)
|
||||||
|
|
||||||
if total > 0:
|
if total > 0:
|
||||||
activator.Write("You have %d mail!" % total)
|
activator.Write("You have %d mail!" % total)
|
||||||
elements = mail.receive(activatorname)
|
elements = mail.receive(activator.Name)
|
||||||
for element in elements:
|
for element in elements:
|
||||||
type, fromname, message = element
|
type, fromname, message = element
|
||||||
if type==1:
|
if type == 1:
|
||||||
msgob = whoami.CreateObject('scroll')
|
msgob = whoami.CreateObject('scroll')
|
||||||
msgob.Name='mail F: '+fromname+' T: '+activatorname
|
msgob.Name = "mail F: %s T: %s" % (fromname, activator.Name)
|
||||||
msgob.NamePl=msgob.Name
|
msgob.NamePl = msgob.Name
|
||||||
msgob.Message=message
|
msgob.Message = message
|
||||||
msgob.Value=0
|
msgob.Value = 0
|
||||||
elif type==2:
|
elif type == 2:
|
||||||
msgob = whoami.CreateObject('note')
|
msgob = whoami.CreateObject('note')
|
||||||
msgob.Name='newspaper D: '+fromname
|
msgob.Name = 'newspaper D: '+fromname
|
||||||
msgob.NamePl='newspapers D: '+fromname
|
msgob.NamePl = 'newspapers D: '+fromname
|
||||||
msgob.Message=message
|
msgob.Message = message
|
||||||
msgob.Value=0
|
msgob.Value = 0
|
||||||
elif type==3:
|
elif type == 3:
|
||||||
msgob = whoami.CreateObject('diploma')
|
msgob = whoami.CreateObject('diploma')
|
||||||
msgob.Name='mailwarning F: '+fromname+' T: '+activatorname
|
msgob.Name = 'warning F: '+fromname+' T: '+activator.Name
|
||||||
msgob.NamePl='mailwarnings F: '+fromname+' T: '+activatorname
|
msgob.NamePl = 'warnings F: '+fromname+' T: '+activator.Name
|
||||||
msgob.Message=message
|
msgob.Message = message
|
||||||
msgob.Value=0
|
msgob.Value = 0
|
||||||
else:
|
else:
|
||||||
Crossfire.Log(Crossfire.LogError, 'ERROR: unknown mailtype\n')
|
Crossfire.Log(Crossfire.LogError, 'ERROR: unknown mailtype\n')
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue