Let the guest account keep their letter
This commit is contained in:
parent
39493528b2
commit
cef7bab8a2
2 changed files with 14 additions and 8 deletions
|
|
@ -114,8 +114,9 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
|
||||||
for tag in self.tags.all():
|
for tag in self.tags.all():
|
||||||
self.tags.remove(tag)
|
self.tags.remove(tag)
|
||||||
|
|
||||||
# Remove everything in their inventory...including letter/ticket
|
# Remove everything in their inventory...excluding the letter:
|
||||||
for obj in self.contents:
|
for obj in self.contents:
|
||||||
|
if obj.name != "letter":
|
||||||
logger.warning(f"Guest account: deleting {obj.name}")
|
logger.warning(f"Guest account: deleting {obj.name}")
|
||||||
obj.delete()
|
obj.delete()
|
||||||
|
|
||||||
|
|
@ -155,7 +156,7 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
|
||||||
"""
|
"""
|
||||||
Return string containing location information from IP address.
|
Return string containing location information from IP address.
|
||||||
"""
|
"""
|
||||||
ip_address = self.account.sessions.get()[0].address
|
ip_address = self.sessions.get()[0].address
|
||||||
if ip_address == "127.0.0.1":
|
if ip_address == "127.0.0.1":
|
||||||
return "(from localhost)"
|
return "(from localhost)"
|
||||||
|
|
||||||
|
|
@ -282,11 +283,16 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
|
||||||
This replaces the weird, auto-generated name with the
|
This replaces the weird, auto-generated name with the
|
||||||
character's actual name.
|
character's actual name.
|
||||||
"""
|
"""
|
||||||
# letter = search_object('letter', location=self).first()
|
letter = self.search('letter', location=self, quiet=True)
|
||||||
letter = self.search('letter', quiet=True)
|
|
||||||
if letter:
|
if letter:
|
||||||
letter = letter[0]
|
letter = letter[0]
|
||||||
text = sub(r"My dear [^,]*", f"My dear {self.name}", letter.db.inside)
|
|
||||||
|
if self.db.guest_account:
|
||||||
|
text = sub(r"My dear[^,]*", "My dearest friend",
|
||||||
|
letter.db.inside)
|
||||||
|
else:
|
||||||
|
text = sub(r"My dear[^,]*", f"My dear {self.name}",
|
||||||
|
letter.db.inside)
|
||||||
letter.db.inside = text
|
letter.db.inside = text
|
||||||
|
|
||||||
def create_ticket(self):
|
def create_ticket(self):
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ class TutorBird(CarriableNPC):
|
||||||
"typeclass": "typeclasses.tutorial.TutorBird",
|
"typeclass": "typeclasses.tutorial.TutorBird",
|
||||||
"key": "bird",
|
"key": "bird",
|
||||||
"aliases": ["cockatiel", "tutor", "tutor bird"],
|
"aliases": ["cockatiel", "tutor", "tutor bird"],
|
||||||
"desc": "You see a tiny bird with gray feathers trimmed with white. It's large black eyes looks at you quizically. Its yellow cheeks are adorable, as it seems overly helpful.",
|
"desc": "Gray feathered bird perched on your shoulder. It's large black eyes looks at you quizically. Its yellow cheeks are adorable, making it seem overly helpful.",
|
||||||
})[0]
|
})[0]
|
||||||
bird.location = character
|
bird.location = character
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue