feat: added emoting support with the 'me' command
This commit is contained in:
parent
8dd1900d90
commit
a196290e36
10
commands.py
10
commands.py
|
@ -107,3 +107,13 @@ def build(mud, id, players, rooms, params):
|
|||
"owner": players[id]["name"],
|
||||
"builders": [players[id]["name"]]
|
||||
}
|
||||
|
||||
|
||||
def me(mud, id, players, rooms, params):
|
||||
if not params:
|
||||
mud.send_message(id, "Invalid params.")
|
||||
return
|
||||
for pid, pl in players.items():
|
||||
if pl["room"] == players[id]["room"]:
|
||||
mud.send_message(pid, "{} {}"
|
||||
.format(players[id]["name"], params))
|
||||
|
|
7
run.py
7
run.py
|
@ -80,6 +80,10 @@ def cmd_build(id, params):
|
|||
cmd.build(mud, id, players, rooms, params)
|
||||
|
||||
|
||||
def cmd_me(id, params):
|
||||
cmd.me(mud, id, players, rooms, params)
|
||||
|
||||
|
||||
def cmd_unknown(id, command):
|
||||
cmd.unknown(mud, command, id)
|
||||
|
||||
|
@ -90,7 +94,8 @@ commands = {
|
|||
"go": cmd_go,
|
||||
"say": cmd_say,
|
||||
"open": cmd_open,
|
||||
"build": cmd_build
|
||||
"build": cmd_build,
|
||||
"me": cmd_me
|
||||
}
|
||||
waitlist_commands = {
|
||||
"help": cmd_whelp,
|
||||
|
|
Loading…
Reference in New Issue