CL_STARTINFO
CONTROL
, CONNLESS
, RESEND
, COMPRESSION
NET_PACKETFLAG_UNUSED = 1
NET_PACKETFLAG_UNUSED
)NET_PACKETFLAG_TOKEN
)NET_CTRLMSG_TOKEN
for 0.7 as wellNET_PACKETFLAG_UNUSED
is unused in 0.6 (as the name suggests) and in 0.7 it is NET_PACKETFLAG_CONTROL
. You get 2 control messages which you detect as 0.7 by that flag. On the second control message which is NET_CTRLMSG_CONNECT
you should (in contrast to 0.6 where this happens on the 3rd packet) create the connection and store the 0.7 state there.NET_CTRLMSG_TOKEN
, you answer with a your server token there, I just use the ip hashing function from ddnet code, no fancy token manager/cache. I believe in 0.7 there is also a 3rd packet but the 3rd packet doesn't carry the client token anymore. Only the first NET_CTRLMSG_TOKEN
and the second NET_CTRLMSG_CONNECT
carry the client token so when you receive the 2nd package check the token against the server token one you sent in the first message and if it matches create the connection. You get the token the client sent you in NET_CTRLMSG_TOKEN
again here. So you don't need to store that back when you get NET_CTRLMSG_TOKEN
. (edited)NET_CTRLMSG_TOKEN
. it's supposed to be a way for the server to verify the client's IP address without storing any data on itUnpackPacket
to make this work1
. So I check if that field is 1
and in that case I assume it's 0.7. I haven't seen a 0.6 client/mastersrv with an ack of 1
yet, I've seen 0
and 3
. (edited)1
1
. So I check if that field is 1
and in that case I assume it's 0.7. I haven't seen a 0.6 client/mastersrv with an ack of 1
yet, I've seen 0
and 3
.
UnpackPacket07
and just have a few lines in Recv
which check for UNUSED flag or known connection and in that case call UnpackPacket07
to unpack the same packet againUnused Token Control Resend cOmpression coNnless (Ack)
0.6 ORNCaaAA
0.6.5 ORNCTUAA
0.7 --NORCAA
The small "a" are unused, the ack is not using those. That's what heinrich used in 0.6.5 to make space for the token flag.
As you can see the connless flag is the same in all versions.
And you can see how the unused flag, that's how heinrich called
it in 0.6.5 can be used to detect 0.7 packets. Because in 0.7
it is the control flag and therefore set during the connection
sequence, in 0.6.5 it's unused (hence the name) and in 0.6 it's
part of the ack but never set.
(edited)CSnapshotBuilder
is your friendCTranslator
and a subclass of it CTranslator07
. On connection when we detect a client is a 07 client we create an instance of CTranslator07
and assign it to a new field in CNetConnection
CServer
calling all the way into CNetConnection
seems a little overreaching to me, but introducing separate translators for every layer of the protocol seems like it'd be too muchREGISTERSTATE_HEARTBEAT
and REGISTERSTATE_REGISTERED
states with the m_RegisterRegisteredServer
(which holds the id of the master server we are connected to: 0-3) set to -1
.extern int Translate(int ID);
isn't exactly something I'm willing to codeTranslate()
NETMSG_MAP_DATA
at a later point, instead we would already translate it here https://github.com/unique-clan/unique-race/commit/5675762cf6fc321ea3a7211f55b08b103b97a8ab#diff-25bcc1bcfab43c7e0957ca2fa89fe34fL953-L959ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
-- * SDL2 not found (using bundled version)
yet it goes ahead and adds the flag -framework SDL2
to the linker invocation-DSDL2_ROOT=/usr/local/lib
to the initial command line fixes the issue?CMake Warning (dev) at CMakeLists.txt:326 (find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
CMake variable SDL2_ROOT is set to:
/usr/local/lib
For compatibility, CMake is ignoring the variable.
message(STATUS "${HINTS_SDL2_LIBDIR}xx${SDL2_LIBDIR}xx${PC_SDL2_LIBDIR}xx${PC_SDL2_LIBRARY_DIR}xx${PATHS_SDL2_LIBDIR}xx${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH})
?find_library
call-- xxxx/usr/local/libxxxxddnet-libs/sdl/mac/lib64xx
[learath2@l2mbp] ~/Desktop/C/ddnet/build [0]$ pkg-config --libs sdl2
-L/usr/local/lib -lSDL2