mirror of
https://github.com/evennia/evennia.git
synced 2026-03-28 02:36:32 +01:00
Useful default typeclass for channels added. Handles poses and provides interfaces for external messages and internal alike.
This commit is contained in:
parent
851e6d00cc
commit
48bcb9d0ba
7 changed files with 267 additions and 107 deletions
|
|
@ -77,20 +77,8 @@ class ChannelCommand(command.Command):
|
|||
string = "You are not permitted to send to channel '%s'."
|
||||
self.msg(string % channelkey)
|
||||
return
|
||||
msg = "[%s] %s: %s" % (channel.key, caller.name, msg)
|
||||
# we can't use the utils.create function to make the Msg,
|
||||
# since that creates an import recursive loop.
|
||||
try:
|
||||
sender = caller.player
|
||||
except AttributeError:
|
||||
# this could happen if a player is calling directly.
|
||||
sender = caller.dbobj
|
||||
msgobj = Msg(db_message=msg)
|
||||
msgobj.save()
|
||||
msgobj.senders = sender
|
||||
msgobj.channels = channel
|
||||
# send new message object to channel
|
||||
channel.msg(msgobj, senders=sender, online=True)
|
||||
channel.msg(msg, senders=self.caller, online=True)
|
||||
|
||||
|
||||
class ChannelHandler(object):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue