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 2021-09-07 00:00:00Z and 2021-09-08 00:00:00Z
Avatar
if you return 0 then snapshots for 0.7 clients are incorrect (you can't see the character for example), but that code looks weird. shouldn't it return pObj->Data() instead of pObj? (edited)
Avatar
why should they be incorrect?
Avatar
they should be correcter
Avatar
I justed tested
18:07
I can't see the character if I return 0
18:08
but returning pObj->Data() works like pObj (maybe better/worse in some hidden way)
Avatar
return 0 is wrong there
Avatar
why?
18:09
it should prevent from sending that object
Avatar
negative netobj types are ones I reserved for "pass-through"
Avatar
ah, okay, because on my server it works, i probably did something different than u
Avatar
Hm actually that's the block above
Avatar
i just dont want weird memory to be written
Avatar
Ah, that's to let Obj_SixToSeven drop some netobjs
Avatar
yeah, then return 0 should be correct
18:11
thats how i handle it too
18:11
CNetXXX = Server()->SnapNewItem()
18:11
if that returns 0, it wont start writing the memory
18:11
if that doesnt return 0, it will
Avatar
If that returns 0 the snap functions will stop snapping
Avatar
which for dropped objects, it should not
18:12
no, why?
Avatar
leading to missing items
Avatar
why does it stop
Avatar
Look at anything that snaps more than one obj. It will do SnapNewItem and if the return is null snap itself will return
Avatar
void *CServer::SnapNewItem(int Type, int ID, int Size) { if(!(Type >= 0 && Type <= 0xffff)) { g_UuidManager.GetUuid(Type); } dbg_assert(ID >= 0 && ID <= 0xffff, "incorrect id"); return ID < 0 ? 0 : m_SnapshotBuilder.NewItem(Type, ID, Size); }
18:12
oh
18:12
you mean it like that
18:13
well, true, but we have to make sure not to write to that memory somehow
18:13
we need to get rid of the returns then, and start using {}
Avatar
Well it is a bit wasteful, but only a teeny tiny bit. I'll accept a PR if you test it very well
18:14
(There is no UB there btw, it's just writing to memory that won't be sent)
Avatar
am i incorrect? because i am currently trying to fix a bug on my server that i dont understand at all
18:14
the one i linked earlier
Avatar
return 0 there would be correct, I think when I made the sixup patch I just wanted to change the least amount of code
Avatar
client somehow receives faulty characterobjects
Avatar
faulty?
18:15
faulty how?
Avatar
yea, they have m_Tick = 4, which is extremely low and CAN NEVER happen at all, leading to running the Evolve extremely slowly
18:15
it frezes the client for several seconds
18:16
and i dont know how on earth this would happen
18:16
i have a demo, which i take for debugging
18:16
because it only happened once for me at all
18:16
others are reporting it more frequently
Avatar
is it just one field that ends up wrong?
Avatar
no, the rest seems to be 0
18:16
and somehow, weird positions occur too
18:17
one at 0,0, few more a bit down of 0,0
Avatar
maybe you corrupt the TypeAndId field of a snap object?
Avatar
how?
Avatar
when debugging snaps for sixup I added dbg_msgs on NewItem and UnpackDelta, if you can reproduce the issue you can check the snap sent and the snap received
Avatar
i cant reproduce it, it just randomly happens
18:19
i only have the demo to reproduce clientside
Avatar
Avatar
fokkonaut
how?
Well if you underflow the Data pointer given to you you could have corrupted the typeandid
Avatar
what is underflow?
Avatar
e.g. accessing Data()[-1] in that case
18:20
i have no idea tbh xd
Avatar
FWIW that entire thing is a bit of meh design, C++ doesn't have flexible array members, so we allocate some space, create a new snap obj there, then we assume there is nothing in the memory after the member data
Avatar
but i dont see where this issue could happen
Avatar
well it sounds very hard to debug, I wish you good luck 😛
18:23
thx tho :D
Avatar
does returning ->Data() here help maybe?
18:25
(or does that at least not have any other bad side effects?)
Avatar
Avatar
Robyt3
but returning pObj->Data() works like pObj (maybe better/worse in some hidden way)
Well at that point I'm just returning a piece of memory the requester can have fun with, the next snapnewitem will overwrite it anyway
Avatar
so that memory is only temporary?
18:27
I was wondering why m_DataSize was not being increased on the "return pObj" branch
Avatar
yep, it's just scratchspace so I don't have to modify the classes themselves, the aim was to keep the huge patch atleast somewhat reviewable
Avatar
@Learath2 could you somehow help me a little? i am getting frustrated already, its been weeks since i am trying to fix this
18:34
i can send you the demo
18:35
and all info i have :D
18:35
i am debugging client with demo
Avatar
I don't know what else I can tell you, a 0 object with a corrupt field sounds like a corrupted type
Avatar
are you using CNetServer::SendMsgs? because I kinda think that's broken.
Avatar
No, i dont even have that in my source, i am 0.7 based
Avatar
Avatar
Robyt3
are you using CNetServer::SendMsgs? because I kinda think that's broken.
iirc it isnt, why do you think so?
18:37
(i can invite you to my repo)
Avatar
at least that's where I ended up when debugging the issue with vanilla 0.6.5 and "sv_vanilla_antispoof 1"
Avatar
Debugging this with a demo sounds unlikely, the issue seems to be the server sending a broken snap
Avatar
but maybe that's just due to the weird map being used
Avatar
Avatar
fokkonaut
(i can invite you to my repo)
not sure how much I can help, as I don't understand the networking very much
Avatar
Avatar
Learath2
Debugging this with a demo sounds unlikely, the issue seems to be the server sending a broken snap
yea
Avatar
with all the 128p stuff you have maybe you are snapping a player that already left or sth in place of someone that took over the id?
Avatar
I'd first try to isolate the issue and find out what kind of snap is invalid
Avatar
Avatar
Learath2
with all the 128p stuff you have maybe you are snapping a player that already left or sth in place of someone that took over the id?
still, it could never get a m_Tick = 4
18:39
which will then take seconds to get to 400k in a while loop
Avatar
if you snap garbage memory it could
Avatar
if a player left, i can not snap him
18:40
character doesnt exists
18:40
snap is not even called
18:40
and it cant take over someone else, because i am explicitly checking while exchaning ids, and making sure there are no doubles
18:40
it just all doesnt match up for me
18:41
let me invite you at least, then you can take a look at these more obivous ones
Avatar
if pragma- were a ddnet contributor he'd tell you the irc debugger is offline 😛
18:43
both of you are invited
Avatar
can anyone help with portable teeuniverse map specialization?
19:07
i want to add int data to my zone type but didn't find anything in teeworlds-ptum
Avatar
ew closed source
19:19
stallman is angry
Avatar
im angry too
Exported 109 message(s)