mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Added msg_type to rpsystem.send_emote()
This commit is contained in:
parent
641811ec1c
commit
22353b2e92
1 changed files with 21 additions and 20 deletions
|
|
@ -213,6 +213,7 @@ _RE_REF_LANG = re.compile(r"\{+\##([0-9]+)\}+")
|
|||
# this regex returns in groups (langname, say), where langname can be empty.
|
||||
_RE_LANGUAGE = re.compile(r"(?:\((\w+)\))*(\".+?\")")
|
||||
|
||||
|
||||
# the emote parser works in two steps:
|
||||
# 1) convert the incoming emote into an intermediary
|
||||
# form with all object references mapped to ids.
|
||||
|
|
@ -375,7 +376,7 @@ def parse_sdescs_and_recogs(sender, candidates, string, search_mode=False, case_
|
|||
match_index = marker_match.start()
|
||||
# split the emote string at the reference marker, to process everything after it
|
||||
head = string[:match_index]
|
||||
tail = string[match_index + 1 :]
|
||||
tail = string[match_index + 1:]
|
||||
|
||||
if search_mode:
|
||||
# match the candidates against the whole search string after the marker
|
||||
|
|
@ -421,7 +422,7 @@ def parse_sdescs_and_recogs(sender, candidates, string, search_mode=False, case_
|
|||
# save search string
|
||||
matched_text = "".join(tail[1:iend])
|
||||
# recombine remainder of emote back into a string
|
||||
tail = "".join(tail[iend + 1 :])
|
||||
tail = "".join(tail[iend + 1:])
|
||||
|
||||
nmatches = len(bestmatches)
|
||||
|
||||
|
|
@ -513,7 +514,7 @@ def parse_sdescs_and_recogs(sender, candidates, string, search_mode=False, case_
|
|||
return string, mapping
|
||||
|
||||
|
||||
def send_emote(sender, receivers, emote, msg_type = "pose", anonymous_add="first", **kwargs):
|
||||
def send_emote(sender, receivers, emote, msg_type="pose", anonymous_add="first", **kwargs):
|
||||
"""
|
||||
Main access function for distribute an emote.
|
||||
|
||||
|
|
@ -1256,19 +1257,19 @@ class ContribRPObject(DefaultObject):
|
|||
self.sdesc.add("Something")
|
||||
|
||||
def search(
|
||||
self,
|
||||
searchdata,
|
||||
global_search=False,
|
||||
use_nicks=True,
|
||||
typeclass=None,
|
||||
location=None,
|
||||
attribute_name=None,
|
||||
quiet=False,
|
||||
exact=False,
|
||||
candidates=None,
|
||||
nofound_string=None,
|
||||
multimatch_string=None,
|
||||
use_dbref=None,
|
||||
self,
|
||||
searchdata,
|
||||
global_search=False,
|
||||
use_nicks=True,
|
||||
typeclass=None,
|
||||
location=None,
|
||||
attribute_name=None,
|
||||
quiet=False,
|
||||
exact=False,
|
||||
candidates=None,
|
||||
nofound_string=None,
|
||||
multimatch_string=None,
|
||||
use_dbref=None,
|
||||
):
|
||||
"""
|
||||
Returns an Object matching a search string/condition, taking
|
||||
|
|
@ -1352,10 +1353,10 @@ class ContribRPObject(DefaultObject):
|
|||
)
|
||||
|
||||
if global_search or (
|
||||
is_string
|
||||
and searchdata.startswith("#")
|
||||
and len(searchdata) > 1
|
||||
and searchdata[1:].isdigit()
|
||||
is_string
|
||||
and searchdata.startswith("#")
|
||||
and len(searchdata) > 1
|
||||
and searchdata[1:].isdigit()
|
||||
):
|
||||
# only allow exact matching if searching the entire database
|
||||
# or unique #dbrefs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue