Skip to content

Commit

Permalink
Add support for video playback in KFO-Client! (no parsing for DRO cli…
Browse files Browse the repository at this point in the history
…ent yet) (#168)
  • Loading branch information
Crystalwarrior authored Dec 26, 2024
1 parent 3c7b7e8 commit 07fcb69
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 3 deletions.
8 changes: 6 additions & 2 deletions server/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,8 @@ def send_ic(self,
third_folder="",
third_emote=0,
third_offset="",
third_flip=0):
third_flip=0,
video=""):
"""
Send an IC message from a client to all applicable clients in the area.
:param client: speaker
Expand Down Expand Up @@ -1214,7 +1215,8 @@ def send_ic(self,
third_folder,
third_emote,
third_offset,
third_flip)
third_flip,
video)
if self.recording:
# See if the testimony is supposed to end here.
scrunched = "".join(e for e in msg if e.isalnum())
Expand Down Expand Up @@ -1269,6 +1271,7 @@ def send_ic(self,
third_emote, # 32
third_offset, # 33
third_flip, # 34
video, #35
)
self.last_ic_message = args

Expand Down Expand Up @@ -1328,6 +1331,7 @@ def send_ic(self,
third_emote, # 32
third_offset, # 33
third_flip, # 34
video, # 35
)
if idx == -1:
# Add one statement at the very end.
Expand Down
149 changes: 148 additions & 1 deletion server/network/aoprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ def net_cmd_ms(self, args):
effect = ""
pair_order = 0
third_charid = -1
video = ""
if self.validate_net_cmd(
args,
self.ArgType.STR, # msg_type
Expand Down Expand Up @@ -565,9 +566,150 @@ def net_cmd_ms(self, args):
self.client.send_ooc(
"Something went wrong! Please report the issue to the developers.")
return
elif self.validate_net_cmd(
args,
self.ArgType.STR, # 0 # msg_type
self.ArgType.STR_OR_EMPTY, # 1 # pre
self.ArgType.STR, # 2 # folder
self.ArgType.STR_OR_EMPTY, # 3 # anim
self.ArgType.STR_OR_EMPTY, # 4 # text
self.ArgType.STR, # 5 # pos
self.ArgType.STR, # 6 # sfx
self.ArgType.INT, # 7 # emote_mod
self.ArgType.INT, # 8 # cid
self.ArgType.INT, # 9 # sfx_delay
self.ArgType.INT_OR_STR, # 10 # button
self.ArgType.INT, # 11 # evidence
self.ArgType.INT, # 12 # flip
self.ArgType.INT, # 13 # ding
self.ArgType.INT, # 14 # color
self.ArgType.STR_OR_EMPTY, # 15 # showname
self.ArgType.STR, # 16 # charid_pair
self.ArgType.STR, # 17 # offset_pair
self.ArgType.INT, # 18 # nonint_pre
self.ArgType.STR, # 19 # sfx_looping
self.ArgType.INT, # 20 # screenshake
self.ArgType.STR, # 21 # frames_shake
self.ArgType.STR, # 22 # frames_realization
self.ArgType.STR, # 23 # frames_sfx
self.ArgType.INT, # 24 # additive
self.ArgType.STR, # 25 # effect
self.ArgType.INT, # 26 # third_charid
):
# AO Golden validation monstrosity
(
msg_type,
pre,
folder,
anim,
text,
pos,
sfx,
emote_mod,
cid,
sfx_delay,
button,
evidence,
flip,
ding,
color,
showname,
charid_pair,
offset_pair,
nonint_pre,
sfx_looping,
screenshake,
frames_shake,
frames_realization,
frames_sfx,
additive,
effect,
third_charid,
) = args
try:
pair_args = charid_pair.split("^")
charid_pair = int(pair_args[0])
if len(pair_args) > 1:
pair_order = pair_args[1]
except ValueError:
self.client.send_ooc(
"Something went wrong! Please report the issue to the developers.")
return
elif self.validate_net_cmd(
args,
self.ArgType.STR, # 0 # msg_type
self.ArgType.STR_OR_EMPTY, # 1 # pre
self.ArgType.STR, # 2 # folder
self.ArgType.STR_OR_EMPTY, # 3 # anim
self.ArgType.STR_OR_EMPTY, # 4 # text
self.ArgType.STR, # 5 # pos
self.ArgType.STR, # 6 # sfx
self.ArgType.INT, # 7 # emote_mod
self.ArgType.INT, # 8 # cid
self.ArgType.INT, # 9 # sfx_delay
self.ArgType.INT_OR_STR, # 10 # button
self.ArgType.INT, # 11 # evidence
self.ArgType.INT, # 12 # flip
self.ArgType.INT, # 13 # ding
self.ArgType.INT, # 14 # color
self.ArgType.STR_OR_EMPTY, # 15 # showname
self.ArgType.STR, # 16 # charid_pair
self.ArgType.STR, # 17 # offset_pair
self.ArgType.INT, # 18 # nonint_pre
self.ArgType.STR, # 19 # sfx_looping
self.ArgType.INT, # 20 # screenshake
self.ArgType.STR, # 21 # frames_shake
self.ArgType.STR, # 22 # frames_realization
self.ArgType.STR, # 23 # frames_sfx
self.ArgType.INT, # 24 # additive
self.ArgType.STR, # 25 # effect
self.ArgType.INT, # 26 # third_charid
self.ArgType.STR_OR_EMPTY, # 27 # video
):
# KFO Client validation monstrosity
(
msg_type,
pre,
folder,
anim,
text,
pos,
sfx,
emote_mod,
cid,
sfx_delay,
button,
evidence,
flip,
ding,
color,
showname,
charid_pair,
offset_pair,
nonint_pre,
sfx_looping,
screenshake,
frames_shake,
frames_realization,
frames_sfx,
additive,
effect,
third_charid,
video,
) = args
try:
pair_args = charid_pair.split("^")
charid_pair = int(pair_args[0])
if len(pair_args) > 1:
pair_order = pair_args[1]
except ValueError:
self.client.send_ooc(
"Something went wrong! Please report the issue to the developers.")
return
else:
self.client.send_ooc(
f"Something went wrong! Please report this to the developers:\n{args}")
return

# Targets for whispering
whisper_clients = None

Expand Down Expand Up @@ -1143,6 +1285,7 @@ def net_cmd_ms(self, args):
third_emote, # 32
third_offset, # 33
third_flip, # 33
video, # 34
)
a_list = ", ".join([str(a.id) for a in target_area])
if not (self.client.area in target_area):
Expand Down Expand Up @@ -1185,6 +1328,7 @@ def net_cmd_ms(self, args):
third_emote,
third_offset,
third_flip,
video,
)
self.client.send_ooc(f"Broadcasting to areas {a_list}")
except (AreaError, ValueError):
Expand Down Expand Up @@ -1312,6 +1456,7 @@ def net_cmd_ms(self, args):
third_emote,
third_offset,
third_flip,
video,
)

return
Expand Down Expand Up @@ -1365,6 +1510,7 @@ def net_cmd_ms(self, args):
third_emote=third_emote,
third_offset=third_offset,
third_flip=third_flip,
video=video,
)
self.client.area.send_owner_ic(
self.client.area.background,
Expand Down Expand Up @@ -1404,6 +1550,7 @@ def net_cmd_ms(self, args):
third_emote,
third_offset,
third_flip,
video,
)

# DRO client support
Expand Down
3 changes: 3 additions & 0 deletions server/tsuserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def __init__(self):
"effects",
"expanded_desk_mods",
"y_offset",
"triplex",
"typing_timer",
"video_support",
]
self.command_aliases = {}

Expand Down

0 comments on commit 07fcb69

Please sign in to comment.