Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories β€” IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2020-04-04 00:00:00Z and 2020-04-05 00:00:00Z
Avatar
Similar to what unique-race has done, this allows 0.7 and 0.6 players to play on the same server: https://github.com/unique-clan/unique-race Start was: https://github.com/unique-clan/unique-race/commit/5675762cf6fc321ea3a7211f55b08b103b97a8ab Ask @timakro for more details Any volunteers up for the task?
Avatar
I can take a look
Avatar
@timakro how did you handle the shift in the packet flags?
Avatar
I can also do it
08:05
@Learath2 what shift do you mean?
Avatar
I thought ddnet added atleast one extra flag
08:11
ah but we don't send it, right
08:12
its only used serverside
Avatar
[quakenet] Learath2 BOT 2020-04-04 08:14:14Z
then I don't get the change in pack and unpack
Avatar
What exactly?
08:15
The split?
Avatar
split and the if sixup block in unpackpacket
08:38
it seems teehistorian misses CL_STARTINFO
Avatar
@heinrich5991 thats true, there needs to be a workaround. This is needed tho, so that we can manually unpack the packet, version dependent
08:46
@Learath2 the split can either be 4 or 6, based on sixup or not
08:46
which sixup block? the flag one or the other one with the security token?
Avatar
I can see what the split can be, I'm asking why, what changed between 0.6 and 0.7 that requires that change
Avatar
if you check the code in 0.7, you can see it starts at other positions
Avatar
And in unpack the very first sixup block that does something with the flags
Avatar
the flags are different for both versions, in 0.7 the control flag is 1, resend is 2 and compression is 4, we are just translating them there
Avatar
I see, missed that change in 0.7
Avatar
thats also why we can even detect 0.7 clients, because they send flags&1, which is control. in 0.6 flags&1 is the unused flag, which never gets sent
Avatar
hmmm
08:51
I'm looking at network.h in 0.6 and 0.7 right now
08:51
I see 0.6 has four flags, which of them is unused?
08:52
CONTROL, CONNLESS, RESEND, COMPRESSION
Avatar
the entry got removed in ddnet, in vanilla you see an actual flag NET_PACKETFLAG_UNUSED = 1
08:52
A retro multiplayer shooter. Contribute to teeworlds/teeworlds development by creating an account on GitHub.
Avatar
ah 0.7 gave more bits to size from seq, that's why the split is different
08:53
bigger packets = faster map download
Avatar
ehm, this isn't accurate
08:53
this is 0.6.5 and up only, not even ddnet
08:53
(@ NET_PACKETFLAG_UNUSED)
Avatar
Wait ddnet has control as 1
Avatar
yes, flags start two bits earlier in 0.6.5
Avatar
was it the 2 bits that are accidentally thought of as part of ack?
Avatar
yes, I think so
08:56
looking into the code right now
Avatar
ah @heinrich5991 the unused flag thing was the thing he did for 0.6.5 <-> 0.7
08:56
yes
Avatar
The extra 2 bits shouldn't really change anything due to bit order though, no?
08:57
the least significant bit is at the end
Avatar
okay, it seems the client only interprets them on receiving, not sending (as the max sequence is 1<<10)
08:58
(that's probably why it could be used for NET_PACKETFLAG_TOKEN)
08:59
ok. seems to be sound (the 0.7 detection)
08:59
on the teehistorian side: teehistorian needs to be informed about 0.7 clients (in ddnet); and no messages can be given to the server but not to teehistorian
Avatar
@heinrich5991 is ddnet even 0.6.5 compatible? I remember there being an issue about this
Avatar
there was an issue by deen IIRC, might just be the vanilla token
09:01
it's not compatible with 0.6.5 tokens
09:01
it's somewhat compatible with 0.6.5 tokens
Avatar
i am so confused right now, now that you said that with the unused flag :D i still have 1 last unused flag check in my own mod and it just works with it, not without? xd well nevermind
Avatar
in that it makes 0.6.5 fall back to the <=0.6.4 protocol
09:02
@fokkonaut well you do need a way to distinguish 0.6 from 0.7 clients
09:02
i mostly decide from the connless packets (edited)
Avatar
ye, that sounds good
Avatar
but there is one last fallback, that checks for it and its somehow needed xD
09:03
nvm tho
Avatar
that doesn't sound good ^^
Avatar
eh
09:03
did you edit that?
Avatar
At a network level, do we know the clients version from the start?
Avatar
we know it from the connect packet
09:04
not sure if fokkonaut edited his message to say something that different, but determining the version from the connect packet is sound
Avatar
no, i decide in the connless packet
Avatar
which connless packet?
09:05
people can connect to the server without having sent a recent connless packet
Avatar
ah yes true, connless packet check is for deciding whether a 0.6 or 0.7 client asked from the browser
Avatar
you should decide it from the connect packet (and afterwards by client IP)
Avatar
cant
Avatar
IP address/port combo, while connected
Avatar
you need to know it before
Avatar
no
Avatar
since the first packet
09:06
yes
Avatar
I can formulate it with words
Avatar
you need to translate flags already
Avatar
so it is possible to program
09:07
unknown client -> check which connect packet
09:07
known client -> we know the version
Avatar
@heinrich5991 NET_CTRLMSG_TOKEN is >0.6.5 right? If we receive that from a connection that connection is new client?
Avatar
check its value
09:07
it should have the same value as a 0.6 flag
Avatar
@Learath2 that's not a connection yet, you shouldn't store anything
09:08
but yes, need to answer NET_CTRLMSG_TOKEN for 0.7 as well
Avatar
yeah I guess not saving state there is safer
Avatar
it's the anti IP spoof measure
09:09
if you save anything, you lose
09:09
ok, so new algorithm
09:10
unknown client: check 0.7 connless message check 0.6 connless message check 0.7 connect message check 0.7 token message check 0.6 connect message discard
09:10
known client:
09:10
we know what to do
Avatar
why bother with the connless message at all?
Avatar
master
09:11
browser
Avatar
well okay, but that's not what I was asking, I just wanted to know where in the connection do we know a 0.7 client is a 0.7 client
Avatar
from the connect message
09:13
it's different in 0.6 and 0.7
Avatar
tbh i dont even know why my whole thing works
09:15
i feel like i should remove it again xd
Avatar
@Learath2 Okay, so NET_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.
Avatar
@timakro packetflag_control is also 1 in 0.6
Avatar
no, it's in a different bit
Avatar
in 0.6 it's the fourth most significant bit (edited)
Avatar
ah, now i understand my thign again xd
Avatar
in 0.7 it's the 6th most significant bit
Avatar
So the first control message is 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)
09:25
gosh how can i call the 2 tokens so you can distinguish them
09:25
warning: in my code the names are totally all over the place
Avatar
client token, server token?
Avatar
lmao
Avatar
they always have "response token" in 0.7 code which kind of depends on the perspective (edited)
09:27
updated the message as good as i could to make that understandable
Avatar
if you needed to store the client token, that would defeat the point of 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 it
Avatar
The Unique Race modification of DDNet. Contribute to unique-clan/unique-race development by creating an account on GitHub.
09:29
This is the connection sequence. There are also changes in UnpackPacket to make this work
09:32
You can skip connless packets right now, that's just for serverstatus and masterservers. The way I check for 0.7 there is a little bit more dangerous I guess. The 0.6 connless packets include an ack field which isn't used because this is connless .... don't ask why they have that field. In 0.7 that's the version field and for now just set to 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. (edited)
Avatar
@timakro btw: your 0.7/0.6 servers are not visible in the 0.6 browser. your version number is 0.7/0.6, that works for 0.7 clients, as they only look for 0.7, but 0.6 clients look for 0.6.x, for example 0.6.4
Avatar
nah thats not the reason
Avatar
it is
09:34
i tried it
Avatar
it should send 0.6/0.7 to 0.6 clients (edited)
09:34
but it doesnt?
09:34
oh it does, but only 1 server
Avatar
i see them all
09:35
except CAN
09:36
ah no 1 is missing
09:37
this might actually be a problem with the ack value detection is was just talking about
09:37
maybe some mastersrvs send an ack of 1
09:37
there might be a better way of distinguishing 0.6/0.7 connless packets
Avatar
yes, check for the contents
Avatar
in 0.7 it's offset by 7 bytes, in 0.6 it's offset by 6 bytes
09:39
hm
Avatar
works fine for me
Avatar
or check the version field maybe?
Avatar
thats a 0.7 only thing iirc
Avatar
yea
Avatar
You can skip connless packets right now, that's just for serverstatus and masterservers. The way I check for 0.7 there is a little bit more dangerous I guess. The 0.6 connless packets include an ack field which isn't used because this is connless .... don't ask why they have that field. In 0.7 that's the version field and for now just set to 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.
@timakro
09:43
ack=version
Avatar
in 0.6 the header is 0xff-ed out except for ddnet
Avatar
https://github.com/fokkonaut/F-DDrace/blob/F-DDrace/src/engine/shared/network_server.cpp#L171-L177 this unpacks the flags the way 0.6 does it, then checks for it, below it is the 0.7 connless check
Avatar
for connless packets
Avatar
After taking a look, I don't really think I can do much better then @timakro, so I guess we should port it
Avatar
please do better with the msg ids
09:45
write some abstraction layer for different msg ids
Avatar
(my personal preference would be to make it more encapsulated from the code)
09:45
(so we don't have 0.7 support littered all over the place, preferably only in one file and callbacks to this place)
Avatar
@heinrich5991 thats what I was looking for too but I couldnt isolate it into the network code
Avatar
you need to go into a lot of ::Snap functions
09:48
F-DDrace is a server mod for Teeworlds 0.7 developed by fokkonaut. - fokkonaut/F-DDrace
Avatar
@Learath2 here's a really old version of mine: https://github.com/heinrich5991/teeworlds/tree/version_7/src/proxy
My fork of teeworlds - if you're looking for something specific I already created, pm me, I usually keep stuff. - heinrich5991/teeworlds
09:49
7 years ago, wow
Avatar
Stupid vanilla moving stuff out of the snap.....
Avatar
My fork of teeworlds - if you're looking for something specific I already created, pm me, I usually keep stuff. - heinrich5991/teeworlds
Avatar
@heinrich5991 is this some translating proxy that works completely separately from the server?
Avatar
no, it works inside the server
09:50
but with very few entry points
09:50
it also worked inside the client IIRC
Avatar
@timakro no, not only this, also the thing above it, that first checks for a 0.6 connless packet
09:51
@timakro first i unpack the flags like it is a 0.6 packet, check if its valid and then go on to the 0.7 check
Avatar
I'll give it a try
Avatar
hmm, I don't see any low-level transformation there
09:51
was that before the network change in 0.7?
09:51
but should be addable with a couple of more hooks
Avatar
@fokkonaut the part above checks for the UNUSED flag
09:52
above = über, oder?
09:52
below is unter
Avatar
ah sorry
09:53
you have the 0.7 flags unpacking ofc
Avatar
yea, you always got confused on it xD
Avatar
@Learath2 this looks like a 0.6-0.5 proxy, the thing I did 😦
09:55
but it shouldβ„’ be applicable to 0.7-0.6 too
Avatar
@Learath2 when you want to minimize entry points you could write a 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 again
09:56
Or maybe directly pass it off somewhere else for the control packet handling
Avatar
@timakro heinrich said, the unused flag is only a 0.6.5+ thing
09:57
but for me it also works xd
Avatar
@fokkonaut So for connless packets your function just returns true?
10:00
I still don't get it
Avatar
for 0.6 connless packets it returns true
10:01
dor 0.7 connless packets false
10:01
sevendwon = 0.6
10:01
and if there is a connection already, it returns what the connection says (is 0.6 or 0.7)
10:02
and if its not a connless packet, and we dont have a connection yet, it returns !(flags&1)
Avatar
but the connless flag ist the same in 0.6 and 0.7, you can't use that to distinguish
Avatar
i can, because in 0.6 the flags are unpacked differently
10:02
as you see here:
10:02
F-DDrace is a server mod for Teeworlds 0.7 developed by fokkonaut. - fokkonaut/F-DDrace
10:02
this is the 0.6 unpacking
Avatar
idk how stuff is unpacked right now but it's effectively the same bit
10:03
well, idk
10:03
but if you compare 0.7/ddnet unpack function, you see that the flags are unpacked differently
Avatar
thats what i do here, i first assume its a 0.6 packet, unpack the flags into a seperate variable, then translate for the connless packet, check for it and then return or not
10:04
if i dont return, i check for 0.7 connless packets
10:04
check those 2 links
Avatar
Unused 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)
Avatar
@Learath2 are you currently trying to do it? does it work?
Avatar
I'm eating, then I'll try
Avatar
ChillerDragon 2020-04-04 11:52:05Z
lel i just recived my first spam/fishing mail ever
11:52
maybe this is a thing now and i wanted to warn u
11:52
11:52
Avatar
Okay now I'm giving it a try
11:53
The idea is to keep to modifications to the code at a minimum, that means translating as much of the 0.7 difference before CServer, if possible even keep it out of the network code
Avatar
@heinrich5991 I don't think I can make something as polished as yours tbh
Avatar
don't want to invest the work (fair) or a roadblocker?
Avatar
I'm not even quite sure where to begin making something like that
Avatar
just keep in mind, that in the end we're doing simple byte transformations. I think this is what led to most of the design. we need a couple of hooks. before network unpacking: to translate the packet headers, before returning from CNetServer: to translate the game messages, before applying the snapshot diffs: to apply the correct snapshot diffs
12:13
(snapshot diffs slightly differ between versions, due to differing object sizes)
Avatar
well the snaphots are actually different too
Avatar
the internals you mean? yes, true. handle that after the snapshot dif
12:15
create a completely new snapshot and modify all the objects in process. you need to put one of the versions into a namespace or do something else to prevent the names from conflicting
12:17
still sounds infeasible? 😦 ok
Avatar
doesn't I'm just taking a look at the code to see all the places I need to hook in
12:22
@heinrich5991 how about I hook into OnSnap where there are changes and construct the snapshots correctly in the first place?
Avatar
it'll get slightly more intertwined with the code that way, but it should also work
Avatar
I'm just not sure if I can re-craft the snapshot
Avatar
CSnapshotBuilder is your friend
Avatar
At that level I don't have access to any of the information needed, I only have the crafted snapshot
Avatar
ah, yes
Avatar
does it even contain enough for me to do all the modifications needed?
12:24
what is new in the snapshots to begin with?
Avatar
snapshots no longer carry player data
12:24
that's a new one
Avatar
dropping stuff should be fairly simple
Avatar
so you'd have to generate messages when you see new players in the snapshot/when players disappear in the snapshot
Avatar
ah true
12:26
so I'd need to keep track of the players separately or hook into the code for the events
Avatar
yes
Avatar
Okay, tell me if this sounds about sane:
12:33
We have a class CTranslator 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
12:33
Before unpacking and after packing for a connection, we call the translator object to perform any required modification
Avatar
(this might generate additional packets)
Avatar
That covers the network layer, what I'm having trouble imagining is the server part, 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 much
Avatar
did you see how I did it? I made a "god" object that all the different layers can call into
12:36
that covered the whole API of the translation layer
Avatar
At the network layer I don't think there'd be any new packets generated
12:36
@heinrich5991 no I had some trouble reading it tbh, did you make it a kernel interface?
Avatar
yes, I did
12:36
sec, searching the link for myself
12:37
okay, entirely undocumented, I'm sorry
Avatar
well making it a kernel interface does actually fix my issue
Avatar
My fork of teeworlds - if you're looking for something specific I already created, pm me, I usually keep stuff. - heinrich5991/teeworlds
12:39
oh actually, it is documented
12:39
the interface
12:39
needs more callbacks though, for the different network layer
Avatar
is the network layer even aware of the kernel anyway?
Avatar
not sure, in case not, just pass it with the other interfaces it needs
Avatar
also another issue is that like this we can only ever have a single translator
Avatar
why?
Avatar
there is a global kernel object that does the translation, how do we differ at the connection level?
12:41
things either go through the translator or they don't
Avatar
the translator gets all the messages
12:41
it keeps track of which client is which
12:42
the god object does that
12:42
so it can figure out which translator to use or any at all
Avatar
Is that a good idea? an observer is usually not the greatest of patterns
Avatar
I don't know what an observer is tbh
Avatar
e.g. the god object observes the server and tracks changes
12:43
what if it falls out of sync?
Avatar
the "observer" here is the source of truth regarding which client is which version
Avatar
ah, the connection doesn't do any tracking at all?
Avatar
i.e. we don't have redundant storage of information here
12:44
yes
Avatar
Okay, so we have a global object that everything goes through
12:45
before being handled by their respective layers
12:45
I guess at the end we could also query the global object about any messages it needs to send for a connection
Avatar
yes
Avatar
do you think the global object should maybe track connections? maybe we can use it for the client too
12:46
e.g. a client that can connect to 0.6 and 0.7
Avatar
yes, the transformation is similar, and indeed, the above mentioned source allowed 0.6 clients to connect to 0.6 servers, too
12:47
lol
12:47
0.5 servers
12:48
that raises a question though, do we have a separate implementation of the "god" object on client and server?
Avatar
I'd do one of them first
12:49
I think it's similar enough to easily adapt the solution of one to the other
Avatar
Yes but if the infrastructure isn't set up properly for it from the beginning it'll just be an overengineered translator, what timakro made but just in a more elaborate package
Avatar
hm.
12:50
ah. yes, maybe a separate god object for client and server would be good
12:50
hm. or do you really need it? maybe not
12:50
I don't know. I guess one would figure out in the implementation? ^^
Avatar
yeah, there is so much we can discuss before just starting to code
Avatar
I don't get the meaning behind that line ^
Avatar
You can plan out some of these things but others you just have to start implementing and see
Avatar
ah
Avatar
atleast for me, I'm not that good at planning things out indepth
Avatar
yes, I also always encounter roadblocks for things I thought I had planned through
12:55
I'll go learn some math, if you're okay for now, @Learath2 ?
Avatar
yeah, hf
Avatar
ty
Avatar
My own problem: I play with cl_default_zoom setting, what means my zoom is always different from "default" one. But there is fng servers where I am forced to use "default" one which renders game at least uncomfortable for playing General problem: Ridiculous client side limitations leads to new clients without such I consider zoom as graphics setting, which should NOT be limited by any gameplay mode (as dynamic camera is) P.s.: some of you might consider it as "cheat" or something ...
13:29
@heinrich5991
Avatar
this is all so complicated...
13:39
what an intertwined mess
13:39
@timakro why was that needed?
Avatar
old clients cant handle projectile moreinfo? I think that's handled waay up the stack
13:45
DDraceNetwork, a cooperative racing mod of Teeworlds - ddnet/ddnet
13:46
@heinrich5991 I think I give up, I don't quite like this construct and I'm not really enjoying coding this
Avatar
@Learath2 i guess i could not send them extra info but that would mean that a lot of client versions miss out on projectile antiping
Avatar
Well they won't be able to handle it, no?
Avatar
note that VERSION_DDNET_ANTIPING_PROJECTILE < 11030
Avatar
Ah did the clients between 604 and 11030 also incorrectly check IsDDNet?
Avatar
I guess there is nothing else you can do
Avatar
+ I can enjoy showing this commit to heinrich :)
13:50
It's a win win situation
Avatar
wait, is zombietoads commit the one that fixed it?
Avatar
It says !UseExtraInfo || !IsDDNet, use extra info is a flag inside the projectile itself
13:51
was that also wrong in those versions?
Avatar
Actually I have no idea how this extra info stuff works
13:52
I needed the DDNET server info hack before for various reasons but lately I noticed that everything seems to work without it but apparently some people are using old clients so I did this
13:54
Avatar
It doesn't check what?
13:54
It calls ExtractInfo which checks UseExtractInfo too
13:54
Extra*
Avatar
ah you're right, idk
Avatar
can you tell me a version that has broken projectiles?
13:55
like one you know for sure
Avatar
11.2.1 is the version before ZombieToads fix and projectiles don't work on unique race servers (until i update them)
Avatar
ah I was reading that if statement wrong
13:58
I'm guessing the person who wrote it read it wrong too
Avatar
which one :D?
Avatar
@Learath2 I mean code it the way you like then, I guess
13:59
deen wants to have it ^^
Avatar
It's supposed to be !(UseExtraInfo() || IsDDNet)
13:59
anyway, that being wrong means you indeed have to fake ddnet
Avatar
@timakro I think you should have just passed the client ID to that function
Avatar
@heinrich5991 I don't see a good way to do this so I really don't feel like doing it at all
Avatar
@heinrich5991 we don't have the client id for connless
Avatar
@fokkonaut seemed interested, maybe he can port it
Avatar
The state-machine-like code in the server that handles the registration at the masterservers in engine/server/register.cpp didn't reallly change between 0.6 and 0.7 but it's still broken. It can get into the REGISTERSTATE_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.
14:09
I don't know why this worked in the first place all those years. I must have changed something in my 0.7 support endeavors so this invalid state doesn't fix itself by reconnecting.
Avatar
(also all the token stuff really gave me a headache)
14:12
((also CNetBase not actually being a net base at all in 0.6 is not fun to work with))
Avatar
((what do you mean, net base?))
Avatar
it's not the parent class of anything, it's just a class that has some static methods
14:13
basically a class abused as a namespace
Avatar
(((there is even a comment in the code saying something in the likes of "Seems like this class is just a collection of functions that fit nowhere else")))
14:14
((((i guess he means base in terms of parent class))))
Avatar
it's better in 0.7 with oy's recent rework where CNetServer and CNetClient are children of CNetBase
Avatar
@Learath2 port what
Avatar
(((((also not knowing how the network code works at this level means I'm just not making any progress but just reading code)))))
14:20
@fokkonaut timakro's patch to handle 0.7 clients on a 0.6 server
Avatar
why doesnt he do itm
14:20
?*
Avatar
He can if he wants to
Avatar
I wouldn't like to pull request what I did for unique race
14:22
I consider the unique race codebase my hack-outlet xD
14:22
A place where I write code that works and doesn't look nice
Avatar
unlike ddnet for me justatest
Avatar
The really low level stuff could kinda be copied, maybe a tiny bit more isolated like heinrich suggested
14:23
But anything in the game/ directories would have to be rewritten for ddnet anyways
14:24
going carefully over all the features and testing
14:29
@Learath2 If you're still interested in doing this (or building the foundation, ddnet has a lot of contributors who can also help with the higher level stuff e.g. 0.7 race support) and you want to see results I can basically tell you what you need to change to talk with 0.7 clients step by step The biggest eyesore in my code is the message id conversion, I'm sure we could find a better solution for that.
Avatar
the conversion id β†’ id or the way you implemented changing the message id in the message bytes itself?
14:30
id to id map is fine
Avatar
the latter
Avatar
the other thing can be fixed by utilizing a packer and repacking that integer
14:30
ID = GetInt();
Avatar
Before doing anything 0.7 protocol related I'd start with this 0.7 patch removing the system flag hack, let me find it for you (edited)
Avatar
NewPacker.AddInt(Translate(ID);
14:31
NewPacker.AddRaw(GetRest());
Avatar
yes that looks good
Avatar
This is all fine and dandy, putting all this stuff in the proper place is the actual problem. extern int Translate(int ID); isn't exactly something I'm willing to code
14:33
pseudo code is easy enough to write, just wrap whatever part needs changes within a Translate()
14:33
this was just about the message ID conversion of @timakro that he disliked
14:34
can you link it, @timakro?
14:35
link the message id conversion?
Avatar
the place where it is applied
14:35
because Learath2 wondered what my pseudocode did
14:35
but I guess it's fine, nvm
Avatar
I even know what the pseudocode does, where is it going to live? some static function in CNetBase like all the other orphans without a home?
14:36
oh where that pseudocode would go
14:36
let me find an example
Avatar
@timakro I think @ChillerDragon already got the system flag fix into ddnet
Avatar
ah nice
14:41
here we send a chunk of map data, my code converts the message id 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-L959
14:41
and also the payload is different, @heinrich5991 how would you do that?
14:42
and don't call the function "Translate" because thats already used for 64 player support
14:46
well and the translate function would take the client id as well ofc
Avatar
I have concluded that there is no good way to do this as overriding things in C++ isn't pretty. That leaves an ugly object that modifies data on the byte level or ugly compatibility code everywhere. I don't like either, so I'll just do the ugly compatibility code everywhere
15:07
I'll move as much of it as I can into a separate class, but that's about it
Avatar
Actually I guess I won't be doing anything as building on macOS is broken again with XCode11
15:19
yay macOS, I'll just go cry in a corner, whoever wants to do it can just go ahead
Avatar
what is the error?
Avatar
ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
Avatar
We've been trying to update an app that contains SFTP access to servers. It uses libssh2. We get the following error: cannot link directly with
15:24
aha
Avatar
why do they have to keep breaking things?
15:27
They should hire Oy
15:28
fixed that one, that breaks sdl2, as expected
Avatar
huh? 😦
Avatar
-- * SDL2 not found (using bundled version) yet it goes ahead and adds the flag -framework SDL2 to the linker invocation
Avatar
okay a clean rebuild fixed that, now I'm forced to link with the bundled version of SDL2
15:32
can I please link with system SDL2 somehow?
Avatar
CMakeCache.txt pls
15:36
and CMakeOut or so
15:37
CMakeFiles/CMake{Error,Output}.log
Avatar
do you have sdl2 installed as a framework (whatever that might mean, idk)?
Avatar
Nah, but I have sdl2 installed and pkg config resolves it just fine
15:41
I guess I can just compile SDL2 as a framework and install that
Avatar
I'm not even sure if that fixes it
Avatar
not like cmake wants to use pkg-config
Avatar
yes, cmake's pkg-config does find it
15:41
I'm not sure where it gets lost, debugging
Avatar
it can indeed link to the framework version if I compile and install it
Avatar
can you try (to help me understand the problem) whether adding -DSDL2_ROOT=/usr/local/lib to the initial command line fixes the issue?
15:46
hmm
15:46
it should prefer the pkg-config version
Avatar
do you want me to uninstall the framework first?
Avatar
if you consider the current state of cmake-detection as a bug, yes
15:52
so probably yes if it's not too much of a hassle @Learath2
Avatar
eeh cmake says its ignoring that variable
Avatar
eh 😦
Avatar
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.
15:54
oh rip irc
15:55
@heinrich5991 aren't the bundled ones supposed to be a last resort?
Avatar
yes
15:56
I don't get how they're found
15:57
can you do a 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})?
15:58
directly before the find_library call
Avatar
-- xxxx/usr/local/libxxxxddnet-libs/sdl/mac/lib64xx
Avatar
what is SDL2 called in /usr/local/lib?
Avatar
libSDL2.dylib
16:02
[learath2@l2mbp] ~/Desktop/C/ddnet/build [0]$ pkg-config --libs sdl2 -L/usr/local/lib -lSDL2
16:14
for a 0.6 packet the first byte is ffffaaaa, for a 0.7 one it's ffffffaa, while unpacking you always shift right 2, for a 0.6 packet the upper 2 bits of the ack would be considered flags?
16:20
if it's not Sixup don't you have to shift right 2 more?
16:23
ah you also upgrade to 0.6.5 flags in this patch
Avatar
pff I wasted so much time on this thing that didn't pan out, there goes my commit spree
Avatar
ChillerDragon 2020-04-04 17:21:51Z
i love the term "commit spree"
Avatar
how will oy respect me if i don't commit every day? 😦
17:32
how will I look my father in the eye and tell him that I didn't commit today?
Avatar
Trafalgar Law 2020-04-04 18:30:46Z
Where is your commit @Learath2 !!
Avatar
im trying but the only thing i have to work on is too hard 😦
Avatar
Trafalgar Law 2020-04-04 18:34:26Z
You will do it πŸ™‚
Avatar
When a teeworlds server is running without players for some time it is really annoying to read the logs since they are spammed with master server information: [...] [2020-01-28 10:01:58][register]:...
18:41
only show success messages when they're the first
18:41
wdyt?
Avatar
@heinrich5991 oy's suggestion sounds sane
Avatar
wanted to show you an easy commit πŸ˜‰
Avatar
Trafalgar Law 2020-04-04 21:15:26Z
@Learath2 Your commit pepesweat
Avatar
it won't happen, shame has been brought upon family
Avatar
Trafalgar Law 2020-04-04 21:43:55Z
pepesweat
Avatar
ChillerDragon 2020-04-04 21:46:36Z
Then it’s a easy commit for you @Trafalgar Law πŸ™‚
Exported 468 message(s)