mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 00:06:30 +01:00
Fixed bugs in new nickhandler implementation.
This commit is contained in:
parent
2f5c895f76
commit
2acff2d1ab
3 changed files with 6 additions and 105 deletions
|
|
@ -647,14 +647,13 @@ class ObjectDB(TypedObject):
|
|||
raw_list = raw_string.split(None)
|
||||
raw_list = [" ".join(raw_list[:i+1]) for i in range(len(raw_list)) if raw_list[:i+1]]
|
||||
# fetch the nick data efficiently
|
||||
nicks = self.db_attributes.filter(db_category__in=("nick_inputline", "nick_channel")).prefetch_related("db_key","db_strvalue")
|
||||
nicks = self.db_attributes.filter(db_category__in=("nick_inputline", "nick_channel"))
|
||||
if self.has_player:
|
||||
pnicks = self.player.db_attributes.filter(
|
||||
db_category__in=("nick_inputline", "nick_channel")).prefetch_related("db_key","db_strvalue")
|
||||
pnicks = self.player.db_attributes.filter(db_category__in=("nick_inputline", "nick_channel"))
|
||||
nicks = list(nicks) + list(pnicks)
|
||||
for nick in nicks:
|
||||
if nick.db_key in raw_list:
|
||||
raw_string = raw_string.replace(nick.db_key, nick.db_data, 1)
|
||||
raw_string = raw_string.replace(nick.db_key, nick.db_strvalue, 1)
|
||||
break
|
||||
return cmdhandler.cmdhandler(_GA(self, "typeclass"), raw_string, sessid=sessid)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue