Skip to content

Commit

Permalink
Support server side messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Aug 25, 2024
1 parent 279a41b commit 07b49b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/data/teeworlds_strings.asm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ s_usage db '[usage] ./teeworlds_asmr "connect 127.0.0.1:8303"', 0x0a
l_s_usage equ $ - s_usage
s_no_cli_args db "[client] no cli arguments given defaulting to connect localhost ...", 0x0a
l_s_no_cli_args equ $ - s_no_cli_args
s_3_stars db "***"
l_s_3_stars equ $ - s_3_stars

s_sending_packet_with_size db "[client] sending packet with size: "
l_s_sending_packet_with_size equ $ - s_sending_packet_with_size
Expand Down
10 changes: 10 additions & 0 deletions src/on_chat.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ on_chat:

print_label s_chat

; check srv msg
cmp r8w, -1
jne .human_msg

.server_msg:
print_label s_3_stars
jmp .message_content

.human_msg:
; get author name
mov rbx, r8
imul rbx, TW_CLIENT_SIZE
lea rsi, [tw_clients + rbx + TW_CLIENT_NAME_OFFSET]
print_c_str rsi

.message_content:
call print_colon
call print_space

Expand Down

0 comments on commit 07b49b3

Please sign in to comment.