Remove hacks and break everything in the process
This commit is contained in:
parent
cd0d5da9fa
commit
01915a5629
|
@ -4,7 +4,7 @@ require_relative 'bytes'
|
|||
|
||||
class NetChunk
|
||||
attr_reader :next, :data, :msg, :sys, :flags
|
||||
@@sent_vital_chunks = 4 # BIG TODO: SEND READY AND SHIT WITH PROPER HEADER
|
||||
@@sent_vital_chunks = 3 # BIG TODO: SEND READY AND SHIT WITH PROPER HEADER
|
||||
|
||||
def initialize(data)
|
||||
@next = nil
|
||||
|
|
|
@ -31,6 +31,14 @@ NETMSG_RCON_LINE = 13 # line that should be printed to the remote console
|
|||
NETMSG_RCON_CMD_ADD = 14
|
||||
NETMSG_RCON_CMD_REM = 15
|
||||
|
||||
# sent by client
|
||||
NETMSG_READY = 18
|
||||
NETMSG_ENTERGAME = 19
|
||||
NETMSG_INPUT = 20 # contains the inputdata from the client
|
||||
NETMSG_RCON_CMD = 21
|
||||
NETMSG_RCON_AUTH = 22
|
||||
NETMSG_REQUEST_MAP_DATA = 23
|
||||
|
||||
NETMSG_INVALID = 0
|
||||
NETMSGTYPE_SV_MOTD = 1
|
||||
NETMSGTYPE_SV_BROADCAST = 2
|
||||
|
|
10
teeworlds.rb
10
teeworlds.rb
|
@ -119,7 +119,9 @@ class TwClient
|
|||
end
|
||||
|
||||
def send_enter_game()
|
||||
@netbase.send_packet([0x40, 0x01, 0x04, 0x27])
|
||||
@netbase.send_packet(
|
||||
NetChunk.create_vital_header({vital: true}, 1) +
|
||||
[pack_msg_id(NETMSG_READY)])
|
||||
end
|
||||
|
||||
##
|
||||
|
@ -330,9 +332,9 @@ class TwClient
|
|||
if @ticks % 8 == 0
|
||||
send_ctrl_keepalive
|
||||
end
|
||||
# if @ticks % 20 == 0
|
||||
# send_chat("hello world")
|
||||
# end
|
||||
if @ticks % 20 == 0
|
||||
send_chat("hello world")
|
||||
end
|
||||
end
|
||||
|
||||
def disconnect
|
||||
|
|
Loading…
Reference in a new issue