-
Notifications
You must be signed in to change notification settings - Fork 51
Fix testimony recording #197
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -525,6 +525,47 @@ def net_cmd_ms(self, args): | |
"While that is not a blankpost, it is still pretty spammy. Try forming sentences." | ||
) | ||
return | ||
|
||
# Here, we check the pair stuff, and save info about it to the client. | ||
# Notably, while we only get a charid_pair and an offset, we send back a chair_pair, an emote, a talker offset | ||
# and an other offset. | ||
|
||
self.client.charid_pair = charid_pair | ||
self.client.offset_pair = offset_pair | ||
if anim_type not in (5, 6): | ||
self.client.last_sprite = anim | ||
self.client.flip = flip | ||
self.client.claimed_folder = folder | ||
other_offset = '0' | ||
other_emote = '' | ||
other_flip = 0 | ||
other_folder = '' | ||
|
||
confirmed = False | ||
if charid_pair > -1: | ||
for target in self.client.area.clients: | ||
if not confirmed and target.char_id == self.client.charid_pair and target.charid_pair == self.client.char_id and target != self.client and target.pos == self.client.pos: | ||
confirmed = True | ||
other_offset = target.offset_pair | ||
other_emote = target.last_sprite | ||
other_flip = target.flip | ||
other_folder = target.claimed_folder | ||
if (pair_order != ""): | ||
charid_pair = "{}^{}".format(charid_pair, pair_order) | ||
break | ||
|
||
if not confirmed: | ||
charid_pair = -1 | ||
send_args = [msg_type, pre, folder, anim, text, | ||
pos, sfx, anim_type, cid, sfx_delay, | ||
button, self.client.evi_list[evidence], | ||
flip, ding, color, showname, charid_pair, | ||
other_folder, other_emote, offset_pair, | ||
other_offset, other_flip, nonint_pre, | ||
sfx_looping, screenshake, frames_shake, | ||
frames_realization, frames_sfx, | ||
additive, effect] | ||
Comment on lines
+559
to
+567
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think the chat args should be turned into a dataclass, it is becoming a hot mess |
||
|
||
if text.startswith('/a '): # Send a message to a specific area the client is CM in | ||
part = text.split(' ') | ||
try: | ||
|
@@ -536,6 +577,7 @@ def net_cmd_ms(self, args): | |
self.client.send_ooc(f'You don\'t own {area.name}!') | ||
return | ||
text = ' '.join(part[2:]) | ||
send_args[4] = text | ||
except ValueError: | ||
self.client.send_ooc( | ||
"That does not look like a valid area ID!") | ||
|
@@ -549,31 +591,36 @@ def net_cmd_ms(self, args): | |
self.client.send_ooc('You don\'t any areas!') | ||
return | ||
text = ' '.join(part[1:]) | ||
send_args[4] = text | ||
elif text.startswith('/testify '): # Start a new testimony in this area. | ||
part = text.split(' ') | ||
text = ' '.join(part[1:]) # remove command | ||
send_args[4] = text | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this line meaningful if send_args[4] is modified immediately afterward again |
||
if not self.client.area.start_testimony(self.client, text): | ||
return | ||
text = '~~-- ' + text + ' --' | ||
send_args[4] = text | ||
color = 3 # orange | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't you need to write the color to the recording as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, because the recording doesn't ever replay the testimony title the way it was said, instead the person who issues the /examine command in IC "says" the title which is passed in plain text, and the orange color is automatically applied to that |
||
elif text.startswith('/examine'): # Start an examination of this area's testimony. | ||
if not self.client.area.start_examination(self.client): | ||
return | ||
text = '~~-- ' + self.client.area.testimony.title + ' --' | ||
send_args[4] = text | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this line meaningful if nothing is done with send_args here, it will be overshadowed by a new send_args below |
||
color = 3 | ||
if self.client.area.is_testifying or self.client.area.is_examining: | ||
if text.startswith('/end'): # End the current testimony or examination. | ||
if not self.client.area.end_testimony(self.client): | ||
return | ||
text = '' | ||
send_args[4] = text | ||
elif text.startswith('/amend '): | ||
part = text.split(' ') | ||
text = ' '.join(part[2:]) | ||
args[4] = text | ||
send_args[4] = text | ||
color = 1 | ||
try: | ||
index = int(part[1]) | ||
if not self.client.area.amend_testimony(self.client, index, args): | ||
if not self.client.area.amend_testimony(self.client, index, send_args): | ||
return | ||
if self.client.area.is_testifying: | ||
return # don't send it again or it'll be rerecorded | ||
|
@@ -586,11 +633,11 @@ def net_cmd_ms(self, args): | |
elif text.startswith('/insert '): | ||
part = text.split(' ') | ||
text = ' '.join(part[2:]) | ||
args[4] = text | ||
send_args[4] = text | ||
color = 1 | ||
try: | ||
index = int(part[1]) | ||
if not self.client.area.insert_testimony(self.client, index, args): | ||
if not self.client.area.insert_testimony(self.client, index, send_args): | ||
return | ||
if self.client.area.is_testifying: | ||
return # don't send it again or it'll be rerecorded | ||
|
@@ -603,8 +650,8 @@ def net_cmd_ms(self, args): | |
elif text.startswith('/add ') and self.client.area.is_examining: | ||
part = text.split(' ') | ||
text = ' '.join(part[1:]) | ||
args[4] = text | ||
self.client.area.testimony.add_statement(tuple(args)) | ||
send_args[4] = text | ||
self.client.area.testimony.add_statement(tuple(send_args)) | ||
color = 1 # green | ||
self.client.area.examine_index = len(self.client.area.testimony.statements) - 1 # jump to the new statement | ||
elif text.startswith('/remove '): | ||
|
@@ -699,38 +746,6 @@ def net_cmd_ms(self, args): | |
self.client.area.evi_list.evidences[self.client.evi_list[evidence] - 1].pos = 'all' | ||
self.client.area.broadcast_evidence_list() | ||
|
||
|
||
# Here, we check the pair stuff, and save info about it to the client. | ||
# Notably, while we only get a charid_pair and an offset, we send back a chair_pair, an emote, a talker offset | ||
# and an other offset. | ||
|
||
self.client.charid_pair = charid_pair | ||
self.client.offset_pair = offset_pair | ||
if anim_type not in (5, 6): | ||
self.client.last_sprite = anim | ||
self.client.flip = flip | ||
self.client.claimed_folder = folder | ||
other_offset = '0' | ||
other_emote = '' | ||
other_flip = 0 | ||
other_folder = '' | ||
|
||
confirmed = False | ||
if charid_pair > -1: | ||
for target in self.client.area.clients: | ||
if not confirmed and target.char_id == self.client.charid_pair and target.charid_pair == self.client.char_id and target != self.client and target.pos == self.client.pos: | ||
confirmed = True | ||
other_offset = target.offset_pair | ||
other_emote = target.last_sprite | ||
other_flip = target.flip | ||
other_folder = target.claimed_folder | ||
if (pair_order != ""): | ||
charid_pair = "{}^{}".format(charid_pair, pair_order) | ||
break | ||
|
||
if not confirmed: | ||
charid_pair = -1 | ||
|
||
if self.client in self.client.area.afkers: | ||
self.client.server.client_manager.toggle_afk(self.client) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, good old bounds checking. no need for
else
here