Skip to content

Commit

Permalink
Failed attempt of sending sys info in 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Dec 17, 2024
1 parent cdb0f3c commit 7f62bba
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/data/teeworlds.asm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ MSG_SYSTEM_PING_REPLY equ 27
MSG_SYSTEM_MAPLIST_ENTRY_ADD equ 29
MSG_SYSTEM_MAPLIST_ENTRY_REM equ 30

MSG6_SYSTEM_INFO equ 1

MSG_GAME_NULL equ 0
MSG_GAME_SV_MOTD equ 1
MSG_GAME_SV_BROADCAST equ 2
Expand Down Expand Up @@ -104,6 +106,8 @@ MAX_SKIN_ARRAY_SIZE equ MAX_SKIN_LENGTH * UTF8_BYTE_LENGTH + 1

MAX_CLIENTS equ 64

GAME_NETVERSION6 db "0.6 626fce9a778df4d4", 0

GAME_NETVERSION db "0.7 802f1be60a05665f", 0
CLIENT_VERSION equ 0x0705

Expand Down
9 changes: 9 additions & 0 deletions src/packet_packer.asm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ send_packet6:
; call println_uint32
; pop rax

push rax
; TODO: somehow we sent too much here
printlnf "size=%d", rdi
print "sending: "
mov rax, udp_send_buf
call print_hexdump
call print_newline
pop rax

call send_udp

; this is for convenience so we can just queue new chunks
Expand Down
2 changes: 1 addition & 1 deletion src/receive_control6.asm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on_ctrl6_msg_connect_accept:

print_label s_got_accept
call send_ctrl6_msg_ack_accept
; call send_msg_info
call send_msg6_info

jmp on_ctrl6_message_end

Expand Down
13 changes: 13 additions & 0 deletions src/send_system.asm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ send_msg_info:
pop_registers
ret

send_msg6_info:
push_registers

packer_reset
pack_str GAME_NETVERSION6
pack_str cfg_password
send_msg MSG6_SYSTEM_INFO, CHUNKFLAG_VITAL, CHUNK_SYSTEM

call send_packet

pop_registers
ret

send_msg_input:
push_registers

Expand Down

0 comments on commit 7f62bba

Please sign in to comment.