feat: added emoting support with the 'me' command

This commit is contained in:
Marlow Alfonso 2023-12-06 23:37:35 +00:00
parent 8dd1900d90
commit a196290e36
2 changed files with 16 additions and 1 deletions

View File

@ -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
View File

@ -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,